There is a bit of a dance to get this to work:
- activate your venv :
source venv/bin/activate
- install pytest :
pip install pytest
- re-activate your venv:
deactivate && source venv/bin/activate
The reason is that the path to pytest
is set by the source
ing the activate
file only after pytest
is actually installed in the venv
. You can’t set the path to something before it is installed.
Re-activate
ing is required for any console entry points installed within your virtual environment.