How to choose venv name or rename it?
See original GitHub issueHello,
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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to rename a virtualenv in Python? - Stack Overflow
Backup the original activate.bat (I copy&pasted then renamed mine BACKUP_activate.bat ). · Right-click and edit activate.bat . · Change VIRTUAL_ENV variable from:
Read more >Name Your Virtual Environments - Set Up a Python Environment
the virtual environment name and then running source <env name>/bin/activate to activate your virtual environment.
Read more >venv — Creation of virtual environments — Python 3.11.1 ...
Running this command creates the target directory (creating any parent directories that don't exist already) and places a pyvenv.cfg file in it with...
Read more >Don't Rename Your Virtualenv Projects | by JJ - Medium
Beware virtualenv users: renaming your project's directory will break your virtual environment (and you may never know it!)
Read more >Python virtualenv and venv dos and don'ts - InfoWorld
Python comes with an automated system for keeping a package set local to ... Don't name the directory of your virtual environment venv...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please reopen this as the title of the issue has not been resolved from the solutions here. How do I rename the virtual environment the poetry sets up with “packagename-TotAllY2LongSlug-py3.8”. I would like just name exactly please?
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 runpoetry add a_package
. Fine, this closes the issue I think! Thanks a lot!