我在virtualenv安装中遇到的异常错误

时间:2014-05-11 04:45:27

标签: python virtualenv osx-mavericks homebrew gevent

当我使用pip install -r requirement.txt命令时,我尝试在新的virtualenv目录中安装一些需求库。我收到了这个错误:

Requirement already satisfied (use --upgrade to upgrade): wsgiref==0.1.2 in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 (from -r requirement.txt (line 19))
Installing collected packages: greenlet, grequests, killproc, kombu, mccabe, pep8, psutil, pyflakes, pytz, redis, requests
  Running setup.py install for greenlet
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -fno-tree-dominator-opts -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/simple.c -o /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/simple.o
    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    clang: error: unknown argument: '-fno-tree-dominator-opts' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    building 'greenlet' extension
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c greenlet.c -o build/temp.macosx-10.9-intel-2.7/greenlet.o
    clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
    error: command 'cc' failed with exit status 1
    Complete output from command /Users/penkzhou/.virtualenvs/JOB_ENV/bin/python -c "import setuptools, tokenize;__file__='/Users/penkzhou/.virtualenvs/JOB_ENV/build/greenlet/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/pip-FNK0mO-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/penkzhou/.virtualenvs/JOB_ENV/include/site/python2.7:
    running install

running build

running build_ext

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T

creating /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -fno-tree-dominator-opts -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/simple.c -o /var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/var/folders/5h/63q1xmj961b7hv9y0ntdt7gc0000gn/T/tmpXfAIrt/simple.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

clang: error: unknown argument: '-fno-tree-dominator-opts' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

building 'greenlet' extension

creating build

creating build/temp.macosx-10.9-intel-2.7

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c greenlet.c -o build/temp.macosx-10.9-intel-2.7/greenlet.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

我安装了brew并且这个instruction安装了Python环境。另一个信息是我在旧的mac帐户上安装了一些带有mac的原始python环境的python库然后我想从头开始并切换到一个新的mac帐户。然后当我在virtualenv环境中安装一些lib时出现上述错误。我是谷歌-mno-fused-madd,但我什么都没有。所以,任何人都知道这件事吗?感谢。

1 个答案:

答案 0 :(得分:0)

好的。我找到了解决方案here。我安装gevent时可能会丢失一些细节。所以我需要首先安装libevent:

brew install libevent

然后我必须设置这个标志,以便gevent可以构建:

export CFLAGS=-I/opt/local/include

之后,我可以在virtualenv中成功安装gevent。愿这对你们有所帮助。