views:

36

answers:

2

Hi, i've got a project in a virtualenv, which uses python2.6, but now i'd like to make it use python2.7. Is there a way to do this without having to backup my project files, re-create the virtualenv for the right python version, and then copy my files back in the virtualenv?

This does not seem to be a big task to do by hand, but being able to automatize this would still be very useful to easily test a project against many python versions, while still being in a virtualenv.

+1  A: 

Just move your project outside of the virutalenv folders. They shouldn't be in there for this exact reason.

Using a different version of python may pull in slightly different packages, so it's best to just create a new virutalenv w/2.7 and install all your dependencies. Then when you want to test against different python versions just have your scripts activate and use the correct env.

sdolan
+1  A: 

To easily test a project against many python versions you could use tox.

J.F. Sebastian
thanks, i think this will be very useful in the future
MatToufoutu
@MatToufoutu: Here's an example where python file is tested in 9 different environments using `tox`: http://github.com/zed/test_glob1
J.F. Sebastian