6

There are many versions of Python, and it becomes difficult to manage them all.

Often I need to install one module into 3 different versions of Python.

Is there a tool which can simplify things?

I'm on Windows.

Thanks.

5
  • 1
    3 different python versions? sounds like some old applications should rather be fixed to work with a recent version. Usually you shouldn't need more than python 2.6 or better 2.7 and python 3.x. Commented Aug 20, 2011 at 8:24
  • @Thiefmaster there are still lots of legacy applications that require 2.4 or 2.5. If you're dealing with them, however, I don't see why you'd need Python 3... Commented Aug 20, 2011 at 9:50
  • Of course.. python 3 is not necessary unless you need it. Using python 2.4/2.5 is bad though since python 2.6 and 2.7 are out for a long time now. Commented Aug 20, 2011 at 9:52
  • @ThiefMaster: I am having trouble thinking of something that is necessary if you don't need it. Commented Aug 24, 2011 at 19:42
  • I didn't say it's necessary. But if you need multiple python versions you unlikely need more than a recent 2.x and 3.x version. Commented Aug 25, 2011 at 7:24

4 Answers 4

2

Are you using virtualenv? If not, you definitely want to check that out: http://pypi.python.org/pypi/virtualenv

It helps you by managing and switching between several virtual Python environments, with different versions of Python if you want to.

There are loads of tutorials of how to set it up, all over dem interweb.

Sign up to request clarification or add additional context in comments.

2 Comments

I don't understand how virtualenv helps me with my problem. Can I change Python version used by virtual environment "on the fly"?
You could set up several virtual environments, one for each Python version that you want to work with, and then just switch between them as you want. It sounds like a headache to try to keep your entire environment except for the Python installation itself.
2

What Legogris said: use virtualenv.

I just answered a question on pip, virtualenv, and virtualenvwrapper applicable here. I highly recommend this combination of tools for maintaining isolated python environments.

As a further point, I strong recommend using the no-site-packages option so that each virtualenv has all its requirements in one place.

Comments

1

Because some modules contain binary code which is linked agains a specific Python version, it will not be possible to instal a module only once. You will always have to install it for each installed version. But if you use pip, you should have a look at pip: dealing with multiple Python versions? Just create a batch file which calls pip for each installed version. That should at least simplify your life.

Comments

-3

I'm not aware of any Python facility for doing that, that's really the OS's job. Debian/Ubuntu, for example, has support for installing multiple versions of Python and installing libraries into each version. I doubt there's any such support in Windows.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.