changed absolute path to create venv and added other command authored by Villerius's avatar Villerius
...@@ -1905,25 +1905,26 @@ If you are working on different projects and you need different Python packages ...@@ -1905,25 +1905,26 @@ If you are working on different projects and you need different Python packages
When you activate this virtual environment, it will create a special virtual Python environment for you. When you activate this virtual environment, it will create a special virtual Python environment for you.
In this virtual environment you can use the **pip** command (without the --user option) and other commands. In this virtual environment you can use the **pip** command (without the --user option) and other commands.
You create a new virtual environment with the command: You create a new virtual environment with one of the following commands:
* $ virtualenv envname * $ virtualenv python3 -m venv /path/to/new/virtual/environmentname
* $ python3 -m venv /path/to/new/virtual/environmentname
You activate a new virtual environment with the command: You activate a new virtual environment with the command:
* $ source envname/bin/activate * $ source /path/to/new/virtual/environmentname/bin/activate
You deactivate a virtual environment with the command (it will not be destroyed): You deactivate a virtual environment with the command (it will not be destroyed):
* (envname) $ deactivate * (envname) $ deactivate
Example: Example:
``` ```
virtualenv Project-A virtualenv /exports/example/projects/Project-A
Using base prefix '/usr' Using base prefix '/usr'
New python executable in /home/username/Project-A/bin/python3.6 New python executable in /exports/example/projects/Project-A/bin/python3.6
Also creating executable in /home/username/Project-A/bin/python Also creating executable in /exports/example/projects/Project-A/bin/python
Installing setuptools, pip, wheel...done. Installing setuptools, pip, wheel...done.
[username@res-hpc-lo01 ~]$ source Project-A/bin/activate [username@res-hpc-lo01 ~]$ source /exports/example/projects/Project-A/bin/activate
(Project-A) [username@res-hpc-lo01 ~]$ (Project-A) [username@res-hpc-lo01 ~]$
... ...
......