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.

Name of the virtualenv

See original GitHub issue

More than I issue is a question: is this https://github.com/pypa/pipenv/blob/d122401869391db4c42fd32cc5020861b8c8cd0a/pipenv/project.py#L131 the only way the virtualenv name is generated? Is there the possibility to specify the name from the command line? If not, it’s a missing feature or rather a defined choice (to have it projectname+hash) ?

Thank you so much, cheers.

p.s: if there is a better place where to ask these questions, please let me know. I’d rather ask in the proper place 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

27reactions
kennethreitzcommented, Dec 18, 2017

this is not going to change any time soon

4reactions
andreagrandicommented, Dec 10, 2017

Hi @techalchemy thanks for your reply. I think you make a very good point and I may need to adjust a few things before I can fully enjoy a pipenv.

@andreagrandi the idea of pipenv is that rather than using pip to install things, you call pipenv install. This way you don’t run the risk of accidentally installing things outside of your project virtualenv.

This is true, but at the same time it could give me unexpected results. If I run pipenv by mistake in the wrong folder (outside of the project) I end up creating another virtualenvironment and I will have the new library in a different virtual environment.

Since it’s based on where your Pipfile is, all that matters is which directory you’re in, which is always visible from the command prompt, you’ll already be able to tell which project pipenv install works on.

You assume that my full path is always visible, but it’s not my case. Not having to worry about the full path, made me shorten it a while ago. When I’m in a folder I see this:

➜  test-pipenv

that’s it! To check the full path I have to use pwd.

But I’ve noticed something even worse (for my usage). After activating the venv shell with pipenv shell I simply deactivated it in the old way, using deactivate. This removed the (test-pipenv-aXJBI-hV) from the command prompt but I was still inside pipenv shell because when I tried to enter again I got this:

➜  test-pipenv ls
Pipfile      Pipfile.lock
➜  test-pipenv pipenv shell
Shell for UNKNOWN_VIRTUAL_ENVIRONMENT already activated.
No action taken to avoid nested environments.
➜  test-pipenv exit
➜  test-pipenv pipenv shell
Spawning environment shell (/bin/zsh). Use 'exit' to leave.
source /Users/andrea/.virtualenvs/test-pipenv-aXJBI-hV/bin/activate
➜  test-pipenv source /Users/andrea/.virtualenvs/test-pipenv-aXJBI-hV/bin/activate
(test-pipenv-aXJBI-hV) ➜  test-pipenv

which was very confusing.

I will keep using pipenv for more time and see if benefits can beat current issues (for me).

Cheers!

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 >
Pipenv & Virtual Environments
virtualenv is a tool to create isolated Python environments. virtualenv creates ... The name of the virtual environment (in this case, it was...
Read more >
Name Your Virtual Environments - Set Up a Python Environment
You can, of course, name your virtual environments however you wish. Why don't we give all our virtual environments a unique name?
Read more >
venv — Creation of virtual environments — Python 3.11.1 ...
Creating virtual environments​​ Running this command creates the target directory (creating any parent directories that don't exist already) and places a pyvenv. ...
Read more >
Python Virtual Environments: A Primer
Virtualenv is a superset of venv and provides the basis for its implementation. It's a powerful, extendable tool for creating isolated Python ...
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