Python - venv

Creating lightweight “virtual environments” allows to use for each python app its own python environment. When we use python apps on the machines in IASpace and a venv is required, we can follow these simple steps:

You might need first to enable running scripts inside powershell:

Open Microsoft Powershell as Administrator and execute

Set-ExecutionPolicy unrestricted -> Yes to All

then

Open Microsoft Powershell

cd C:\path\to\your\python\project

python -m venv venv

venv\Scripts\activate

Open OSX Terminal

cd path/to/your/python/project

python -m venv venv

If you happen to have python 3 installed you might need to use this command:

python3 -m venv venv

and then..

source venv/bin/activate

Open Terminal

cdcd path/to/your/python/project

python -m venv venv

source venv/bin/activate
Last updated bymartin froehlich