Virtual environment - ArnauMiro/pyLowOrder GitHub Wiki

Virtual environment without conda

A virtual environment without conda can be created using python:

python -m venv /path/to/new/virtual/environment
. /path/to/new/virtual/environment/bin/activate

The proceeding is then identical to the deployment and prerequisites section and the python path to the virtual environment must be added to the current python path:

export PYTHONPATH=~/.local/lib/python3.7/site-packages:$PYTHONPATH

Virtual environment with conda

The package can be installed in a Python virtual environement to avoid messing with the system Python installation. Next, we will use Conda for this purpose. Assuming that Conda is already installed, we can create a virtual environment with a specific python version and name (my_env) using

conda create -n my_env python=3.8

The environment is placed in ~/.conda/envs/my_env. Next we activate it be able to install packages using conda itself or another Python package manager in the environment directory:

conda activate my_env

Then just follow the instructions on the deployment and prerequisites section.