If you install Python normally on your system, multiple versions will not coexist.
Therefore, virtualenv can be used only when an independent Python environment is specified.
If the current working directory is project /
$ virtualenv ENV_NAME
This command creates a globally installed copy of Python under project / ENV_NAME
(* ENV_NAME can be specified as you like with the name of the copy environment)
The environment is now copied, but even if you type the python
command in the terminal, python for the entire system will start.
$ source ENV_NAME/bin/activate
Now when you type the python
command, ʻENV_NAME / bin / python will be executed. (
{Copy environment path} / bin:` is added to the beginning of PATH)
$ virtualenv -p /path/to/other/python ENV_NAME
There is pythonz etc. as a tool to insert various versions of Python that is the copy source.
Recommended Posts