Installing Python Virtual Environment
Windows
-
Open an elevated PowerShell session and navigate to the
robustestfolder. -
Install pip (if not already available):
python -m pip install --upgrade pipIf you encounter permission errors:
pip install --user --upgrade pip -
Install virtualenv and create the virtual environment:
pip install --user virtualenv py -m virtualenv virtualenv -
Activate the virtual environment:
.\virtualenv\Scripts\activateIf you see an error about running scripts, run the following first:
Set-ExecutionPolicy RemoteSignedType A and press Enter, then re-run the activate command.
-
Install dependencies:
pip install -r requirements.txtThe
requirements.txtfile is located in therobustestfolder. -
Deactivate when done:
deactivate -
Set the
VIRT_ENVenvironment variable:- Search for env in the Windows search bar → Edit the system environment variables.
- Click Environment Variables → New under User Variables.
- Variable name:
VIRT_ENV - Variable value:
C:\Users\<username>\robustest\virtualenv
-
Inside
~/robustest/virtualenv, rename theScriptsfolder tobin.
Mac and Linux
-
Open Terminal and navigate to the
robustestfolder. -
Install pip and create the virtual environment:
python -m pip install --upgrade pip pip install virtualenv virtualenv virtualenv -
Activate the virtual environment:
source ~/robustest/virtualenv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Deactivate when done:
deactivate
