Poetry: How to choose venv name or rename it?

Created on 27 Jun 2018  路  2Comments  路  Source: python-poetry/poetry

Hello,

Thanks for this great software!

I'm currently trying it with a new project and see the virtual environment's name is set to 'project-name.py3.6' (for python 3.6 projects) and I would like to rename it.

I have actually changed the venv's directory's name. It shows up correctly in the prompt, and poetry show -v seems to take it into account correctly. Also, I have changed all the occurrences of the default name in the virtual environment scripts. Is it enough? Could there be some side effects I cannot detect now, that could turn out problematic later?

Alternatively, I guess that could be nice to be able to choose the venv name directly when creating a new project.

Most helpful comment

OK, for some reason I thought poetry had to run outside the virtual environment (while doing everything inside it).

So, good, it's possible to create the venv via python -m venv name, source path/to/venv/bin/activate and then run poetry add a_package. Fine, this closes the issue I think! Thanks a lot!

All 2 comments

According to the docs: poetry will also detect if you are inside a virtualenv and install the packages accordingly. So, poetry can be installed globally and used everywhere.

My approach is using an virtual environment wrapper like pew to choose whatever name I want. https://github.com/berdario/pew

OK, for some reason I thought poetry had to run outside the virtual environment (while doing everything inside it).

So, good, it's possible to create the venv via python -m venv name, source path/to/venv/bin/activate and then run poetry add a_package. Fine, this closes the issue I think! Thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings