未找到安装工具
我从 Linux 切换到 OSX,当我运行构建的 setup.py 脚本时,我收到一条错误消息,其中包含以下文本
此脚本需要 setuptools 版本 0.6c7。
我已经尝试了几次安装setuptools,并验证了setuptools Egg存在于/Library/Python/2.6/site-packages中。我不知道为什么它不被认可。
I am switching from Linux to OSX and when I run our build's setup.py script, I get an error message that contains the text
This script requires setuptools version 0.6c7.
I have tried several times to install setuptools, and have verified that the setuptools egg exists in /Library/Python/2.6/site-packages. I have no idea why it is not being recognized.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
OS X 系统上有多个版本的 Python 是很常见的。在最近发布的 OS X 中,Apple 本身发布了两个版本(在
/usr/bin
中)。您可能已经使用 python.org 中的安装程序(通常存在于/Library/Frameworks/Python.framework
中)或使用 MacPorts 等软件包分发程序(安装在/opt/ 中)安装了更新版本local/Library/Frameworks/Python.framework
)。请记住,每个版本的 Python 都需要自己的setuptools
副本,因为您报告的站点包路径是
/Library。 /Python/2.6/site-packages
,您很可能在 OS X 10.6 中使用了 Apple 提供的 Python 2.6.1 来尝试安装新版本的setuptools
。 Apple 已经为其 Python 提供了 setuptools(10.6 中的 2.6.1 为 0.6c9),相应的 easy_install 命令位于 /usr/bin 中;如果您使用的是其他非 Apple 提供的 Python,请按照说明安装新版本的
setuptools
(或Distribute
),确保您调用正确版本的 . Python。检查您的 shell PATH 和which python
以确保。如果这没有帮助,请使用更多信息更新您的问题。
更新:根据您的进一步评论,您的默认站点包目录中似乎有问题。解决了这个问题并确定安装了 Apple 提供的
setuptools
版本 0.6c9,您尝试安装的软件包似乎正在寻找特定的早期版本的 setuptools, 0.6c7。如果是这种情况,您应该首先确定原因以及是否有必要。很可能这只是包的setup.py
文件中的版本规范不正确,即使用==
而不是>=
。如果可以的话,编辑 setup.py 以便它可以使用更新的版本。万一该包确实确实需要特定旧版本的setuptools
(甚至可能无法与该版本的 Python 或 OS X 配合使用),您可以尝试安装旧版本,如下所示:但是如果可能的话,您确实应该避免这样做,因为这将在
/usr/local/ 中安装另一个旧版本的
并可能导致安装和使用其他软件包时出现问题。easy_install
binIt is very common to have multiple versions of Python on OS X systems. In recent releases of OS X, Apple has shipped two versions itself (in
/usr/bin
). You may have installed more recent versions using installers from python.org (which generally exist in/Library/Frameworks/Python.framework
or using a package distributor like MacPorts (which install in/opt/local/Library/Frameworks/Python.framework
). Keep in mind that each version of Python requires its own copy ofsetuptools
.Since the site package path you report is
/Library/Python/2.6/site-packages
, it is most likely you have used the Apple-supplied Python 2.6.1 in OS X 10.6 to try to install a new version ofsetuptools
. Note that Apple already suppliessetuptools
for its Pythons (0.6c9 for 2.6.1 in 10.6); the correspondingeasy_install
commands are in/usr/bin
.If you are using another non-Apple-supplied Python, follow the instructions to install a new version of
setuptools
(orDistribute
) making sure you are invoking the right version of Python. Check your shell PATH andwhich python
to make sure.If that doesn't help, update your question with more information.
UPDATE: Based on your further comments, it seems something was amiss in your default site-packages directory. With that problem out of the way and having established that there is an Apple-supplied
setuptools
version 0.6c9 installed, it appears the package you are trying to install is looking for a specific, earlier version of setuptools, 0.6c7. If that is the case, you should first determine why that is and if it is necessary. Chances are that it is just an incorrect version specification in the package'ssetup.py
file, i.e. using==
rather than>=
. If you can, edit the setup.py so it can use a newer version. In the unlikely event that the package really does need that specific older version ofsetuptools
(which may not even work with that version of Python or OS X), you could try installing the older version, like so:But you really should avoid doing that if at all possible as that will install another older version of
easy_install
in/usr/local/bin
and could cause problems with installing and using other packages.您是否尝试过在 setup.py 脚本中导入 setuptools ?
这解决了我过去的 setuptool-ish 构建问题。
Have you tried to import setuptools in your
setup.py
script?This solved my setuptool-ish build problems in the past.