/ * I confirmed it on Ubuntu 14.04 for the time being. * /
Suppose you have already created a directory called env2_7 with pyvenv.
$ source env2_7/bin/activate
$ python -V
Python 2.7.6
I wanted to do that.
I'll change the python symbolic link under bin in the virtual environment directory I created.
It seems that symbolic links to each Python are put under the bin of the generated virtual environment. I changed the symbolic link of python and activated it, and it actually worked.
This is what it looks like
$ tree env2_7
env2_7
├── bin
│ ├── activate
│ ├── activate.csh
│ ├── activate.fish
│ ├── python -> python3.4
│ ├── python3 -> python3.4
│ └── python3.4 -> /usr/bin/python3.4
...
Re-establish the symbolic link,
$ ln /usr/bin/python2.7 env2_7/bin/python --symbolic
Such.
$ tree env2_7
env2_7
├── bin
│ ├── activate
│ ├── activate.csh
│ ├── activate.fish
│ ├── python -> /usr/bin/python2.7
│ ├── python3 -> python3.4
│ └── python3.4 -> /usr/bin/python3.4
...
If anyone knows how to do it with the first pyvenv
command, please let us know in the comments.
Recommended Posts