Search code examples
pythonpython-3.xvirtualenvpython-poetry

Where to locate virtual environment installed using poetry | Where to find poetry installed virtual environment


I installed poetry using the following command:-
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
To know more about it refer this.

Now I wanted to create a virtual environment, that I created it using the following command:-
poetry config virtualenvs.in-project true
To know more about it refer this.

But after doing this, I can`t see any .venv(virtual environment) folder.

To check if virtual environment is there, we use the following command:-
poetry config virtualenvs.in-project
and if the above command return true, implies you have it.

I'm getting true, also the location mentioned on the docs I cant see it there.

Could anyone tell me how to locate the virtual environment now?


Solution

  • There are 2 commands that can find where the virtual environment is located.

    1. poetry show -v
      The first line of this command will tell you where the virtual environment is located.
      And the rest will tell you which packages are installed in it.

    2. poetry env info -p
      The above command will give you just the location of the virtual environment.