question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to choose venv name or rename it?

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

110reactions
Zaffercommented, Jul 24, 2021

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?

10reactions
nicolashainauxcommented, Jun 28, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found