Problem trying to install PyCurl on Mac Snow Leopard

送分小仙女□ 提交于 2019-12-03 16:08:33

I ran into the same issue when trying to install from pip and easy_install. I got it installed and working by downloading the pycurl source and compiling for Snow Leopard. In the pycurl source directory, before you run "python setup.py install" as the install.txt says, you need to run this:

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DHAVE_CURL_SSL=1 -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/pycurl.c -o build/temp.macosx-10.6-universal-2.6/src/pycurl.o

Basically, it's the same compilation flags EXCEPT for -arch PPC, which was causing it to fail on Snow Leopard.

Once you run the command above, then you can run:

python setup.py install

And it should all be working.

You passed the following flags to the compiler when compiling PyCurl:

ARCHFLAGS="-arch x86_64"

It seems that you have compiled PyCurl in 64-bit mode, while you use the 32-bit Python. Have you tried it with ARCHFLAGS="-arch i386"?

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