Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My server has Python 2.6 installed by default. I don't dare mess with the defaults, so I've installed Python 2.7 and Python 3.2 in separate locations and switch between them using bash alias as I need them. I'm having some problems using pip and apt-get to install python packages, since they are installed as egg files to Python 2.6 dist-packages folder. I have my PYTHONPATH set to a folder where I've tried copying the egg without success.

How do I go about copying eggs between Python installations, or perhaps even share eggs between them?

share|improve this question

1 Answer 1

You can't (or shouldn't try to) copy or share eggs between different Python versions. You need to install each package separately for each version.

apt-get isn't going to help you if you are using Python versions not supported by that particular Debian release.

The basic way to do this anyway is to get the source code for each package and run pythonX.Y setup.py install (or whatever the specific command is) N times.

Alternatively, you could get yourself a separate copy of easy_install for each Python version (using the method above) and then run easy_install-X.Y package (or whatever you installed it under) N times. (pip will probably work the same way, but I don't have much experience with it.)

A good way to manage all this is using virtualenv. Create yourself a virtual environment for each Python version, activate it, and then just run python or easy_install or whatever directly. This is basically an organized and sophisticated way of doing exactly what you are attempting with your bash aliases.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.