pip install" 和 "setup.py install" 的最大递归深度
我在一台Macbook(OS X 10.6.8)上尝试安装一个叫做splinter的包,但总是遇到最大递归错误。无论是用“setup.py install”还是“pip install”,无论是全局安装还是使用虚拟环境,都会出现这个问题。而且这个问题在Python 2.7.1和2.7.2下都存在。无论我怎么做,问题都在。
值得注意的是,似乎没有其他人遇到过splinter包的问题。
这是我错误追踪中的循环部分:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 177, in run
self.find_sources()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 252, in find_sources
mm.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 306, in run
self.add_defaults()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/egg_info.py", line 330, in add_defaults
sdist.add_defaults(self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/sdist.py", line 264, in add_defaults
for pkg, src_dir, build_dir, filenames in build_py.data_files:
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/build_py.py", line 39, in __getattr__
self.data_files = files = self._get_data_files(); return files
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/build_py.py", line 44, in _get_data_files
self.analyze_manifest()
File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command/build_py.py", line 92, in analyze_manifest
self.run_command('egg_info')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
我的Python路径:
/Users/gimli/Work/LocalSystemGimli/troubleshooting/splinter_install
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.0-py2.7.egg
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.6.4-py2.7.egg
/Users/gimli/Work/LocalSystemGimli/troubleshooting/splinter_install
/opt/local/www
/opt/local/www/swage_block/libraries/django_tastypie
/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
/Library/Python/2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/lxml-2.3-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/python_dateutil-1.5-py2.6.egg
/Library/Python/2.6/site-packages/python_digest-1.7-py2.6.egg
/Library/Python/2.6/site-packages/simplejson-2.1.6-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages
/Library/Python/2.6/site-packages/mimeparse-0.1.3-py2.6.egg-info
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
pip.log里有很多警告,内容是“警告:manifest_maker: 找不到标准文件'-c'”。
setuptools.__version__
是0.6c9,setuptools.distutils.__version__
是2.7.2。
奇怪的是,setuptools模块的__file__
在2.6的安装目录下,而setuptools.distutils的__file__
在2.7的安装目录下。
我怀疑问题出在我安装的2.7版本或者某个依赖模块上(我的电脑原本安装的是2.6),但我实在搞不清楚问题出在哪里。
1 个回答
你需要为你的 Python 2.7 安装一个单独的版本,要么是 Distribute
,要么是 setuptools
(这两个是 easy_install
命令的来源)。每个 Python 实例都必须有自己的版本。在 10.6 版本的系统中,苹果自带的 Python 自带了自己的 easy_install
,位置在 /usr/bin
,而 setuptools
则在苹果提供的包里。你安装的 Python 2.7 并不会自动带上这些东西。注意在错误追踪信息中,你会看到是从 Python 2.7 开始,然后又从 2.6 版本中找到了 setuptools
。所以,千万不要在 PYTHONPATH 中混用不同版本的 Python!