Instructions for creating Python virtual environments for versions 3.6 and 2.7.
- Load the python environment:
– For Python 2.7: $ module load anaconda2/4.4.0
– For Python 3.6: $ module load anaconda3/4.4.0 - Create the directory to the Python environment:
– For Python 2.7: $ virtualenv python2 #virtualenv creates folder in current directory that you’re in
– For Python 3.6 $ python3 -m venv /path/to/virtual/environment - Load your environment (both 2.7 & 3.6):
$ source /path/to/virtual/environment/bin/activate
4. To leave the virtual environment.
$ deactivate