|
|
|
|
|
by abrichr
1181 days ago
|
|
Agreed, never had a problem with this approach. The only limitation I've encountered is when moving the environment or renaming one of the parent directories. In which case it's easy to create a new one: # optional: freeze the environment if you don't already have a requirements.txt
source .venv/bin/activate
pip freeze > requirements.txt
deactivate
# remove the old environment
rm -rf .venv
# create a new one
python3.10 -m venv .venv
# activate it
source .venv/bin/activate
# install the requirements
pip install -r requirements.txt
|
|