Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 
like image 925
jldupont Avatar asked Jun 10 '11 01:06

jldupont


People also ask

Is setup py install deprecated?

py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. I found a very detailed write-up explaining this issue: "Why you shouldn't invoke setup.py directly" (October 2021).

How do I uninstall Python setup?

Navigate to Control Panel. Click “Uninstall a program”, and a list of all the currently installed programs will display. Select the Python version that you want to uninstall, then click the “Uninstall” button above the list – this has to be done for every Python version installed on the system.

What is a py egg file?

A “Python egg” is a logical structure embodying the release of a specific version of a Python project, comprising its code, resources, and metadata. There are multiple formats that can be used to physically encode a Python egg, and others can be developed.

What does setup py Sdist do?

The sdist command processes this template and generates a manifest based on its instructions and what it finds in the filesystem. If you prefer to roll your own manifest file, the format is simple: one filename per line, regular files (or symlinks to them) only.


1 Answers

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

like image 91
xolox Avatar answered Oct 06 '22 09:10

xolox