“'cc' failed with exit status 1” error when install python library

强颜欢笑 提交于 2019-11-27 03:21:05
Seth

Run these two lines in your shell before you build:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Those exports tell the compiler to ignore unused arguments rather than complaining about them.


The reason seems to be that Python is compiling modules using the options that it was built with, except one of those options no longer works in mavericks:

the clang 3.4 Apple is shipping defaults to erroring on unknown flags, but CPython builds modules using the same set of flags it was compiled with originally.

(from: https://stackoverflow.com/a/22315129/65295)

Lots of people are running into this:

YPCrumble

For me the issue was that I had just upgraded XCode and needed to install the command line tools (see this answer).

After running xcode-select --install my python library installed fine.

Installing with (inside of the program folder you pulled down)

sudo -E python setup.py install

did the job!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!