gpt4 book ai didi

django - Amazon Linux EC2实例上的uWSGI安装异常

转载 作者:行者123 更新时间:2023-12-04 17:00:06 25 4
gpt4 key购买 nike

我是一名新手,尝试使用nginx,django,uWSGI和mySQL在Amazon EC2上为我的第一个电话应用程序设置服务器。

我正在关注这些教程(实际上,第二个教程是基于第一个教程的):

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
http://www.oliverelliott.org/article/computing/tut_setup_nginx_django/

我使用的是MacbookPro,并且在终端机中一次进入SSH进入Amazon Linux EC2实例。
在安装时,会出现uwsgi ..麻烦。
我执行了:

$ sudo yum install python-pip
$ sudo yum install python-devel
$ sudo pip install uwsgi

前两个工作正常,最后一个命令抛出异常:
    Downloading/unpacking uwsgi
Running setup.py egg_info for package uwsgi
Installing collected packages: uwsgi
Running setup.py install for uwsgi
using profile: buildconf/default.ini
detected include path: ['/usr/include', '/usr/local/include']
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-root/uwsgi/setup.py", line 109, in <module>
distclass=uWSGIDistribution,
File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "/tmp/pip-build-root/uwsgi/setup.py", line 71, in run
conf = uc.uConf(get_profile())
File "uwsgiconfig.py", line 687, in __init__
raise Exception("you need a C compiler to build uWSGI")
Exception: you need a C compiler to build uWSGI
Complete output from command /usr/bin/python26 -c "import setuptools;__file__='/tmp/pip-build-root/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l8npX4-record/install-record.txt --single-version-externally-managed:
running install

using profile: buildconf/default.ini

detected include path: ['/usr/include', '/usr/local/include']

Traceback (most recent call last):

File "<string>", line 1, in <module>

File "/tmp/pip-build-root/uwsgi/setup.py", line 109, in <module>

distclass=uWSGIDistribution,

File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup

dist.run_commands()

File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands

self.run_command(cmd)

File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command

cmd_obj.run()

File "/tmp/pip-build-root/uwsgi/setup.py", line 71, in run

conf = uc.uConf(get_profile())

File "uwsgiconfig.py", line 687, in __init__

raise Exception("you need a C compiler to build uWSGI")

Exception: you need a C compiler to build uWSGI

----------------------------------------
Command /usr/bin/python26 -c "import setuptools;__file__='/tmp/pip-build-root/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-l8npX4-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/uwsgi
Storing complete log in /root/.pip/pip.log

我尝试了两条建议,但似乎对我没有用:
$ export CC=gcc && pip install -r requirements.txt 


$ sudo CC=gcc pip install uwsgi

有什么建议么?在此先多谢!!

最佳答案

该链接为我提供了帮助:uWSGI: Installing from a distribution package

我做了:

yum groupinstall "Development Tools"
yum install python-devel

然后:
pip install uwsgi

然后它起作用了。

关于django - Amazon Linux EC2实例上的uWSGI安装异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26066845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com