19

This is not a duplicate of this question.

I am already aware of virtualenv and virtualenvwrapper and pip but they don't quite seem to have exactly what I want.

I'm looking for a way that I can not only have multiple versions of Python installed but also multiple versions of Django (for example) and mix and match the "active" version of python and the "active" version of Django.

e.g. I've got Django 1.0, 1.1, and 1.2, and trunk is "active". I want to be able to test it on Python 2.5, 2.6 and 2.7. Then make Django 1.2 "active" and test it on all of my Python versions again.

I can see how I could potentially get by using virtualenv for that example, but say I've got 5 releases of a Django application that I want to test on every combination of Python 2.5, 2.6 and 2.7 and Django versions 1.0, 1.1, and 1.2. At this point, afaik, the number of virtual environments that I'm going to need to create is becoming unmanageable.

I'd like to just be able to say, make Python version X "active", make Django version X "active", and make MyApp version X "active" without having to deal with creating and switching virtualenvs (and I definitely don't want to be doing a bunch of bootstrap scripting).

Does the thing that I'm looking for exist for Python, or is there something that I'm missing about virtualenv, virtualenvwrapper, and pip that can already handle this elegantly?

Community
  • 1
  • 1
Matthew J Morrison
  • 4,343
  • 3
  • 28
  • 45
  • To add to my testing example: for anyone who is interested in testing multiple dependency versions against multiple Python versions "tox" is a great tool for this – Matthew J Morrison Nov 16 '12 at 22:26

2 Answers2

7

I believe pythonbrew is what you're looking for.

Edit: pyenv looks like the preferred solution since 2013.

Aissen
  • 1,500
  • 1
  • 11
  • 17
  • After having used buildout for quite a while I decided that virtualenv was a better way to go even thought it's not quite what I was looking for. pythonbrew looks EXACTLY like what I was looking for, thanks! – Matthew J Morrison May 16 '12 at 12:33
  • FYI: The link says `pythonbrew` is deprecated. – Jace Browning Dec 16 '13 at 20:32
  • Thanks, I've taken it into account. I should probably remove the pythonbrew reference alltogether. – Aissen Dec 17 '13 at 09:14
3

I believe you can use buildout to do this, though I'm not particularly familiar with it... E.g. http://blog.mfabrik.com/2010/07/16/easily-install-all-python-versions-under-linux-and-osx-using-collective-buildout-python/

Joe Kington
  • 275,208
  • 71
  • 604
  • 463
  • 1
    after watching this: http://video.google.com/videoplay?docid=3428163188647461098# I'm convinced, I think this should work nicely, thanks! – Matthew J Morrison Aug 15 '10 at 01:45