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 can I get a predictable virtualenv dirname?

See original GitHub issue

My environment

  1. Ubuntu 16.04.3 LTS
  2. Python version: Python 2.7.12
  3. Pipenv version: pipenv, version 8.3.2

What confused me?

$ echo $WORKON_HOME
/home/wonder/PyEnvs

$ pipenv --where
/home/wonder/workspace/myproj

$ pipenv --venv
/home/wonder/PyEnvs/myproj-BKbQCeJj

Why is BKbQCeJj in my virtualenv dirname? Can it be predictable? And can I custom it to be simply myproj?

Why it is a problem?

The Autocomplete-Python plugin of Atom needs to know the Python executable paths to work properly with every individual project.

I’ve been using virutalenvwrapper, which gives me predictable path names, So I can pass /home/wonder/PyEnvs/$PROJECT_NAME/bin/python to Autocomplete-Python, let it find the right python path for a project.

Now with pipenv’s postfixed paths, Autocomplete-Python stopped working. So any helps?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:16
  • Comments:24 (13 by maintainers)

github_iconTop GitHub Comments

37reactions
kennethreitzcommented, Jan 17, 2018

We’re not changing our approach here.

26reactions
joshfriendcommented, Nov 14, 2017

I wholeheartedly agree that PIPENV_VENV_IN_PROJECT should be default! The name and location are always predictable, its just <project root>/.venv.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Renaming a virtualenv folder without breaking it - Stack Overflow
This will make some of the files created by setuptools or distribute use relative paths, and will change all the scripts to use...
Read more >
Python virtualenv and venv dos and don'ts - InfoWorld
This can have unpredictable effects on imports later. Use a name that describes your project unambiguously.
Read more >
Trying to come up with a default directory name for virtual ...
The question On Twitter I asked people for suggestions for an environment variable name to store the default/typical name they use for ...
Read more >
Using virtualenv to Manage Your Own Python Environment
Create a virtual environment with a new directory name, such as ~/myenv . The virtualenv tool will create the directory for you.
Read more >
Tips and Tricks — virtualenvwrapper 4.8.5.dev15 documentation
Justin Abrahms posted about some code he added to his shell environment to look at the directory each time he runs cd ....
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