For a long time virtualenv Show archive.org snapshot was used to create isolated Python environments. This is not required anymore.
Since Python 3.3 a native venv module Show archive.org snapshot is shipped.
direnv
setup
A fast way to use this is the Python venv support Show archive.org snapshot from direnv Show archive.org snapshot :
echo "layout python python3" >> .envrc
echo "cowsay" >> requirements.txt
direnv allow
pip install -r requirements.txt
which cowsay
${PWD}/.direnv/python-3.10/bin/cowsay