How to create a virtualenv with a different python path than the ones installed?

1

I am using virtualenv to install some packages of my projects so that they do not conflict, but I need to use a version of python that is not installed on the system, as I use linux the same already comes with 2.7 and to 3.5 installed, but I need to use 3.4.0, but I did not want to install a new version of python on the system, how could I create a virtualenv with a specific python version?

    
asked by anonymous 17.12.2016 / 02:06

2 answers

1

Take a look at the pyenv project with it you can easily install several different versions of python without affecting versions already installed in the OS

After installing pyenv, simply install the python version you want (e.g.):

$ pyenv install 3.4.2

With the python version installed, you only need to create virtualenv by pointing to the desired python version (e.g.)

$ virtualenv -p ~/.pyenv/versions/3.4.2/bin/python venv
    
17.12.2016 / 14:15
0

If your environment is anaconda:

  

conda create --name my_amb_py34 python = 3.4

Details on link

    
19.06.2018 / 15:12