Skip to content Skip to sidebar Skip to footer

How To Change The Python Version That A Virtual Environment Uses In Ubuntu 14.04?

I am having trouble because I have an existing django project app which I am currently working under a virtual environment. However, the python version for that environment is 2.7.

Solution 1:

Activate your old Python 2.7 enviroment:

source /path/to/your/env/bin/activate

Save dependencies:

pip freeze > env.txt

Create new Python 3.x enviroment:

virtualenv -p python3 newenvname

Activate new environment and install all dependencies from the old environment from env.txt:

source newenv/bin/activate
pip install -r env.txt

Post a Comment for "How To Change The Python Version That A Virtual Environment Uses In Ubuntu 14.04?"