To make sure the configs
module is always available, you can set the PYTHONPATH
permanently by adding it to your shell configuration file.
-
Open your terminal.
-
Edit your shell configuration file:
- For bash (default on many systems):
nano ~/.bashrc
- For zsh (default on newer macOS versions):
nano ~/.zshrc
- For bash (default on many systems):
-
Add the following line at the end of the file:
export PYTHONPATH=$PYTHONPATH:/Users/kushidhar/Projects/project_orion/automation_pytest
pip freeze > requirements.txt
VIRTUAL ENV SETUP
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
pytest tests_question_api
deactivate
-
Open cmd or PowerShell
-
Set PYTHONPATH locally or in environment variables.
- For cmd
set PYTHONPATH=%PYTHONPATH%;C:\Users\kushidhar\Projects\project_orion\automation_pytest
- For PowerShell
$env:PYTHONPATH="$env:PYTHONPATH;C:\Users\kushidhar\Projects\project_orion\automation_pytest"
-
Virtual environment setup
VIRTUAL ENV SETUP python -m venv venv source venv/Scripts/activate.ps1 (For PowerShell) source venv/Scripts/activate.bat (For cmd) pip install -r requirements.txt pytest tests_question_api deactivate