简体   繁体   中英

Pyenv: activate local venv

I use poetry to manage my projects dependencies and tests. I usually create a new virtual environment for each project, with a .venv directory inside of the project directory.

I would like to use pyenv virtualenv to automatically activate this projects virtualenv when inside the project directory as a local one, eg:

pyenv virtualenv local <my venv that also lives inside of this project>

Is this achievable, or do I have to create my virtualenvs inside the.pyenv directory?

When inside the project directory, any command starting poetry run will be run inside the virtual environment created by poetry.

To avoid having to use poetry run before each command, poetry shell can be used to activate the virtual environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM