Set up a Python Virtual Environment

A Python Virtual Environment is a folder containing a standalone Python installation. It is recommended to create a new Virtual Environment for each Python project, as this helps track project dependencies and enables sharing of Python projects.

To set up a Python Virtual Environment:
  1. Create a new Virtual Environment using the following commands (replacing path\to\myenv with the desired path for the new folder).
    Windows
    cd C:\Program Files\Altair\EDEM version\common\python\python3.8\win64
    python.exe -m venv --system-site-packages C:\path\to\myenv
    Linux
    cd ~/<version number>/altair/common/python/python3.8/linux64/bin
    ./python -m venv --system-site-packages ~/path/to/myenv

    Once the environment has been created, you must activate it so that any further Python commands or scripts will run inside this new version of Python.

  2. Activate the Virtual Environment using the following commands:
    Windows (Command Prompt)
    path\to\myenv\Scripts\Activate.bat
    Windows (PowerShell)
    path\to\myenv\Scripts\Activate.ps1
    Linux
    source path\to\myenv\bin\activate
    For more information, see the official Python documentation.
  3. Once the environment is active, see Install EDEMpy to install EDEMpy.
    1. To deactivate the environment at any time, use the deactivate command.