Changes
Page history
changed absolute path to create venv and added other command
authored
Jul 09, 2020
by
Villerius
Show whitespace changes
Inline
Side-by-side
home.md
View page @
93442037
...
...
@@ -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.
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:
*
$ virtualenv envname
You create a new virtual environment with one of the following commands:
*
$ 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:
*
$ source
env
name/bin/activate
*
$ source
/path/to/new/virtual/environment
name/bin/activate
You deactivate a virtual environment with the command (it will not be destroyed):
*
(envname) $ deactivate
Example:
```
virtualenv Project-A
virtualenv
/exports/example/projects/
Project-A
Using base prefix '/usr'
New python executable in /
home/username
/Project-A/bin/python3.6
Also creating executable in /
home/username
/Project-A/bin/python
New python executable in /
exports/example/projects
/Project-A/bin/python3.6
Also creating executable in /
exports/example/projects
/Project-A/bin/python
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 ~]$
...
...
...
...