Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
390 views
in Technique[技术] by (71.8m points)

python - stopping setup.py from installing as 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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

python setup.py install --single-version-externally-managed --root=/

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 the setup.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 a setup.py script you can run the following command in that directory to install the package using pip:

pip install .

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...