0

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?

matwasilewski
  • 384
  • 2
  • 11
  • Does this answer your question? [How to automatically activate virtualenvs when cd'ing into a directory](https://stackoverflow.com/questions/45216663/how-to-automatically-activate-virtualenvs-when-cding-into-a-directory) – Roman-Stop RU aggression in UA Jan 05 '22 at 18:24

1 Answers1

0

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.

elukem
  • 1,068
  • 10
  • 11