Clone
2
How to create a virtualenv and activate it immediately in a script
Ryan Boehning edited this page 2020-11-18 13:34:06 -08:00
# PROBLEM
pyenv virtualenv 3.9.0 foo-3.9.0
poetry install # won't install packages to the new virtualenv!
# SOLUTION
pyenv virtualenv 3.9.0 foo-3.9.0
export VIRTUAL_ENV="$(pyenv virtualenv-prefix)/envs/foo-3.9.0"
poetry install # installs packages to the new virtualenv