我在OSX 10.6上安装了预装的python 2.6,并希望通过easy_install或setup.py(在下载的软件包中)安装python软件包。在我的情况下,我试图安装MySQLdb。在这两种情况下,我得到它结束,像这样一个堆栈跟踪:OSX上的“No module named _scproxy”
...
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/easy_install.py", line 21, in <module>
from setuptools.package_index import PackageIndex, parse_bdist_wininst
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/package_index.py", line 2, in <module>
import sys, os.path, re, urlparse, urllib2, shutil, random, socket, cStringIO
File "/System/Library/Frameworks/Python/framework/Versions/2.6/lib/python2.6/urllib2.py", line 111, in <module>
from urllib import (unwrap, unquote, splittype, splithost, quote,
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py", line 1335, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: No module named _scproxy
蟒蛇安装未修改的预装版本2.6.1,除了我的源文件添加到lib文件夹。 “find /System/Library/Frameworks/Python.framework/ -name scproxy”不会产生任何结果。
如何安装缺少的模块?
为了执行Jacob Oscarson的配方(下面),我需要安装OSX开发人员工具(gcc和东西)。我不知道我做了什么,但事后我可以使用setuptools(无需编译python)。感谢你的努力,Jacob! – 2011-05-17 07:06:09
对于2015年出现在这里的人,优胜美地因此无法构建共享模式:http://hamelot.co.uk/programming/osx-gcc-dispatch_block_t-has-not-been-declared-invalid-typedef/(object .H:143)。进行编辑,“make sharedmods”并继续。 – 2015-01-19 23:01:34