阻止 setup.py 作为 Egg 安装
如何阻止 setup.py 将软件包安装为 Egg?或者更好的是,如何easy_install
将软件包安装为egg
?
sudo python setup.py install
原因是 PyDev
对 egg
格式的包相当挑剔......我目前感兴趣的包是 boto
。
更新:我找到了暴力的方法:
sudo easy_install -m boto
cd path/to/boto-xyz.egg
sudo mv boto ..
sudo rm -rf boto-xyz.egg
How do I stop setup.py
from installing a package as an egg? Or even better, how do I easy_install
from installing a package as an egg
?
sudo python setup.py install
The reason being that PyDev
is rather picky about packages in egg
format... The package I am interested in at the moment is boto
.
Update: I found the brute force way of doing it:
sudo easy_install -m boto
cd path/to/boto-xyz.egg
sudo mv boto ..
sudo rm -rf boto-xyz.egg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案 1:
我觉得我错过了一些微妙或重要的东西(在提出问题多年后遇到此页面,但没有找到令人满意的答案),但是以下内容对我来说效果很好:
压缩
*.egg
文件是 setuptools 的发明(我不是它们的忠实粉丝,尽管我明白为什么它们被创建)并且因为setup.py
脚本正在使用(并且可能需要)setuptools,该包最终被安装为压缩的*.egg
文件。解决方案 2:
上面的命令行选项类似于那些< /a> 由 pip(Python 包管理器)使用,它暗示了另一种阻止包作为压缩
*.egg
文件安装的方法:只需使用 pip!如果您有一个包含setup.py
脚本的目录,则可以在该目录中运行以下命令以使用 pip 安装软件包:这是对
setup.py
的改进上面的命令,因为它跟踪附加元数据(例如,跟踪已安装的文件可以更可靠地删除)。Solution 1:
I feel like I'm missing something subtle or important (encountering this page years after the question was asked and not finding a satisfying answer) however the following works fine for me:
Compressed
*.egg
files are an invention of setuptools (I'm not a big fan of them although I understand why they were created) and because thesetup.py
script is using (and may require) setuptools, the package ends up being installed as a compressed*.egg
file.Solution 2:
The command line options above are similar to those used by pip (the Python package manager) which hints at another way to stop a package from being installed as a compressed
*.egg
file: Just use pip! If you have a directory containing asetup.py
script you can run the following command in that directory to install the package using pip:This is an improvement over the
setup.py
command above because it tracks additional metadata (e.g. tracking of installed files allows for more reliable removal).多年后,同样的问题,对接受的答案不满意。在 Google 群组中找到了这个:
说明:
python setup.py sdist
创建一个源发行版,它自然不是 *.egg!生成的存档(在 unix 中为 .tar.gz,在 windows 中为 .zip)可以像使用 pip 的任何远程模块一样进行安装。它甚至不需要额外的参数!这会产生所需的完全可浏览的模块。Years later, same problem, not satisfied with the accepted answer. Found this in Google groups:
Explanation:
python setup.py sdist
creates a source distribution which naturally is not an *.egg! The resulting archive (.tar.gz in unix, .zip in windows) can be installed like any remote module with pip. It doesn't even require additional parameters! This results in the desired fully browsable module.