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.
-
Create a new Virtual Environment using the following commands (replacing
path\to\myenv
with the desired path for the new folder).Windows
Linuxcd C:\Program Files\Altair\EDEM version\common\python\python3.8\win64 python.exe -m venv --system-site-packages C:\path\to\myenv
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.
-
Activate the Virtual Environment using the following commands:
Windows (Command Prompt)
Windows (PowerShell)path\to\myenv\Scripts\Activate.bat
Linuxpath\to\myenv\Scripts\Activate.ps1
For more information, see the official Python documentation.source path\to\myenv\bin\activate
-
Once the environment is active, see Install EDEMpy to install EDEMpy.
- To deactivate the environment at any time, use the
deactivate
command.
- To deactivate the environment at any time, use the