我的应用需要使用 PyCurl,所以我尝试在我的 Mac 上安装它,但我发现了很多问题和错误。
要求:首先我不得不说,在我的 Mac 上运行的 Python 版本是基于 32 位的,因为我需要使用 WxPython,它需要 32 位 Python。为此,我使用了:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
要安装 PyCurl,我使用了:
sudo env ARCHFLAGS="-arch x86_64" easy_install setuptools pycurl
终端返回:
Best match: setuptools 0.6c11
Processing setuptools-0.6c11-py2.6.egg
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin
Using /Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools
Finished processing dependencies for setuptools
Searching for pycurl
Best match: pycurl 7.16.2.1
Processing pycurl-7.16.2.1-py2.6-macosx-10.6-universal.egg
pycurl 7.16.2.1 is already the active version in easy-install.pth
Using /Library/Python/2.6/site-packages/pycurl-7.16.2.1-py2.6-macosx-10.6-universal.egg
Processing dependencies for pycurl
Finished processing dependencies for pycurl
所以我认为 pycurl 已正确安装并且可以正常工作,但是当我启动我的应用程序时,python 返回了一个错误:
python /Users/lorenzodenobili/Desktop/Python/AGGIORNATORE_PY/Dropbox/wxPython/test.py
Traceback (most recent call last):
File "/Users/lorenzodenobili/Desktop/Python/AGGIORNATORE_PY/Dropbox/wxPython/test.py", line 20, in <module>
import pycurl
File "build/bdist.macosx-10.6-universal/egg/pycurl.py", line 7, in <module>
File "build/bdist.macosx-10.6-universal/egg/pycurl.py", line 6, in __bootstrap__
ImportError: dlopen(/Users/lorenzodenobili/.python-eggs/pycurl-7.16.2.1-py2.6-macosx-10.6-universal.egg-tmp/pycurl.so, 2): no suitable image found. Did find:
/Users/lorenzodenobili/.python-eggs/pycurl-7.16.2.1-py2.6-macosx-10.6-universal.egg-tmp/pycurl.so: mach-o, but wrong architecture
我真的不知道如何解决这个错误,所以我真的需要你的帮助!