Python and Virtual Environment#

Python 3.10 Installation Guide#

Note

Python 3.10 is currently the only version that is supported

  1. Download and install the latest version of Python 3.10 from Python.org (e.g. Python 3.10.11).

    If this is the only installation of Python on the computer, check the option to add Python to PATH during installation (as shown below). If there are several versions of Python installed, make sure that the correct one is being used when running the application.

    ../../_images/AddPythontoPath.png

    It is recommended to disable the path length limit in Windows by clicking the button at the end of the Python installation, as it may prevent errors caused by deep folder structures.

    ../../_images/MaxPathLength.png
  2. Open a terminal window and run the following command to verify that the python version you just installed is accessible on PATH.

    >>> python --version
    Python 3.10.11
    

Create a Virtual Environment (venv) in Python#

Note

The following commands assume that the correct python version is on PATH. If you do not have python on PATH, please use the full path to the python executable when creating the virtual environment.

Start by creating a virtual environment in a given directory.

python -m venv \path\to\venv

After creating the venv, activate it by running the following command

\path\to\venv\Scripts\Activate.ps1

Start by creating a virtual environment in a given directory.

python -m venv \path\to\venv

After creating the venv, activate it by running the following command

\path\to\venv\Scripts\activate.bat

Start by creating a virtual environment in a given directory.

python -m venv /path/to/venv

After creating the venv, activate it by running the following command

source /path/to/venv/Scripts/activate