Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing the python version used in a virtualenv

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.

like image 957
mdeous Avatar asked Dec 13 '22 18:12

mdeous


1 Answers

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.

like image 164
Sam Dolan Avatar answered Dec 31 '22 12:12

Sam Dolan