我在一台新电脑(mac 10.9.2)上,试图引导我公司的项目,但是 setuptools 失败了。
我可以运行 python bootstrap.py,它会创建 ./bin/buildout,但是当我运行 buildout 时,它返回以下错误:
Traceback (most recent call last):
File "./bin/buildout", line 17, in <module>
import zc.buildout.buildout
File "/Users/miah/Documents/realmassive/joson/eggs/zc.buildout-1.7.1-py2.7. egg/zc/buildout/buildout.py", line 40, in <module>
import zc.buildout.download
File "/Users/miah/Documents/realmassive/joson/eggs/zc.buildout-1.7.1-py2.7. egg/zc/buildout/download.py", line 20, in <module>
from zc.buildout.easy_install import realpath
File "/Users/miah/Documents/realmassive/joson/eggs/zc.buildout-1.7.1-py2.7. egg/zc/buildout/easy_install.py", line 29, in <module>
import setuptools.archive_util
File "build/bdist.macosx-10.9-intel/egg/setuptools/archive_util.py", line 15, in <module>
ImportError: cannot import name ContextualZipFile
我已尝试通过https://pypi.python.org/pypi/setuptools#unix-including-mac-os-x-curl
homebrew 安装它。
答案1
我在 Debian 系统上遇到了类似的问题。似乎最新版本的 setuptools (4.0.1) 出了问题,这可能是您为全新安装而下载的 setuptools 版本。我通过清除错误的安装并强制使用 3.8 来解决问题pip install setuptools==3.8