It is a memorandum.
For example, suppose you have the Python 2.7 executable in / usr / bin / python
and the Python 3.4 executable in / usr / bin / python3
.
At this time, if you mkvirtualenv with the default settings, / usr / bin / python
will be copied to ~ WORKON_HOME / # {envname} / bin / python
.
The point is that if you normally mkvirtualenv, a copy of the python environment that appears with which python
will be created, but for example, you want to create a virtual environment for Python3, or / opt / bin / python2.6
. I think that there is a version and you may want to use this one.
In such a case, it is a method to explicitly specify the Python executable file to be used in virtualenv.
$ which python3
/usr/bin/python3
$ mkvirtualenv py3test --python=/usr/bin/python3
Running virtualenv with interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in py3test/bin/python3
Also creating executable in py3test/bin/python
Installing setuptools, pip...done.
(py3test)$
(py3test)$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11) ## Python3.It's 4! !!
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Let's specify the --python
option when mkvirtualenv. This option can be passed directly from virtualenvwrapper to virtualenv to serve its purpose.
Recommended Posts