无法在Mac OS X 10.9.5上安装uWSGI

时间:2014-10-15 15:32:00

标签: python macos uwsgi

当我尝试在Mac OS X 10.9.5中安装uWSGI时,我收到以下错误:

Installing collected packages: uwsgi
  Running setup.py install for uwsgi
    plugins/python/pyutils.c:14:22: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
     if (((exc)->ob_type == &PyClass_Type)) {
          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    plugins/python/pyutils.c:14:22: note: remove extraneous parentheses around the comparison to silence this warning
     if (((exc)->ob_type == &PyClass_Type)) {
         ~               ^               ~
    plugins/python/pyutils.c:14:22: note: use '=' to turn this equality comparison into an assignment
     if (((exc)->ob_type == &PyClass_Type)) {
                         ^~
                         =
    1 error generated.
    Complete output from command /Users/jakob/.virtualenvs/uwsgi/bin/python -c "import setuptools, tokenize;__file__='/Users/jakob/.virtualenvs/uwsgi/build/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/sk/51hn9dcn0b9g6mggg4wkmb6w0000gp/T/pip-p4efMm-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jakob/.virtualenvs/uwsgi/include/site/python2.7:

我使用Python 2.7.5在virtualenv中运行,尝试升级pyutils。有什么想法吗?

这是完整的日志:

~/t/uwsgi $ vf new uwsgi                                                                                                                                                 
New python executable in /Users/jakob/.virtualenvs/uwsgi/bin/python
Installing setuptools, pip...done.
(uwsgi) ~/t/uwsgi $ python --version                                                                                                                                      
Python 2.7.5
(uwsgi) ~/t/uwsgi $ pip install uwsgi                                                                                                                                    
Downloading/unpacking uwsgi
  Real name of requirement uwsgi is uWSGI
  Using download cache from /Users/jakob/.pip/cache/pypi%2Fpackages%2Fsource%2Fu%2FuWSGI%2Fuwsgi-2.0.7.tar.gz
  Running setup.py (path:/Users/jakob/.virtualenvs/uwsgi/build/uwsgi/setup.py) egg_info for package uwsgi

Installing collected packages: uwsgi
  Running setup.py install for uwsgi
    plugins/python/pyutils.c:14:22: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
     if (((exc)->ob_type == &PyClass_Type)) {
          ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    plugins/python/pyutils.c:14:22: note: remove extraneous parentheses around the comparison to silence this warning
     if (((exc)->ob_type == &PyClass_Type)) {
         ~               ^               ~
    plugins/python/pyutils.c:14:22: note: use '=' to turn this equality comparison into an assignment
     if (((exc)->ob_type == &PyClass_Type)) {
                         ^~
                         =
    1 error generated.
    Complete output from command /Users/jakob/.virtualenvs/uwsgi/bin/python -c "import setuptools, tokenize;__file__='/Users/jakob/.virtualenvs/uwsgi/build/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/sk/51hn9dcn0b9g6mggg4wkmb6w0000gp/T/pip-p4efMm-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jakob/.virtualenvs/uwsgi/include/site/python2.7:
    running install

plugins/python/pyutils.c:14:22: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]

 if (((exc)->ob_type == &PyClass_Type)) {

      ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

plugins/python/pyutils.c:14:22: note: remove extraneous parentheses around the comparison to silence this warning

 if (((exc)->ob_type == &PyClass_Type)) {

     ~               ^               ~

plugins/python/pyutils.c:14:22: note: use '=' to turn this equality comparison into an assignment

 if (((exc)->ob_type == &PyClass_Type)) {

                     ^~

                     =

1 error generated.

----------------------------------------
Cleaning up...
Command /Users/jakob/.virtualenvs/uwsgi/bin/python -c "import setuptools, tokenize;__file__='/Users/jakob/.virtualenvs/uwsgi/build/uwsgi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/sk/51hn9dcn0b9g6mggg4wkmb6w0000gp/T/pip-p4efMm-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/jakob/.virtualenvs/uwsgi/include/site/python2.7 failed with error code 1 in /Users/jakob/.virtualenvs/uwsgi/build/uwsgi
Storing debug log for failure in /Users/jakob/.pip/pip.log

(uwsgi) ~/t/uwsgi $ pip freeze                                                                                                                                           
wsgiref==0.1.2

3 个答案:

答案 0 :(得分:11)

使用export CC=/usr/bin/llvm-gcc使其有效。

答案 1 :(得分:2)

使用brew install uwsgi可能是一个不错的选择并为我工作。

参考:http://macappstore.org/uwsgi/

答案 2 :(得分:0)

如果您有anaconda环境
您可以使用conda install -c conda-forge uwsgi
Conda doc