无法在Mac OS X 10.9.5上安装uWSGI

4

在尝试在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版本,尝试升级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个回答

12

使用export CC=/usr/bin/llvm-gcc使其正常工作。


这并没有提供问题的答案。如果您想对作者进行批评或请求澄清,请在他们的帖子下留言。 - Blackhole
4
没错,这就是答案。通过运行命令export CC=/usr/bin/llvm-gcc,然后再运行pip install uwsgi即可解决问题。 - jakobht

5

1
如果您已经安装了Anaconda环境, 您可以使用conda install -c conda-forge uwsgi
Conda文档

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接