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.

Pipenv chooses wrong project path

See original GitHub issue

When creating a new environment with pipenv --python 3, it does not use the current directory as the project home, but instead chooses a directory two directories up from the current working directory, as illustrated here:

 ~/P/mpx-python-api    pwd
/Users/loke/Projects/mpx-python-api
 ~/P/mpx-python-api    pipenv --python 3
Creating a virtualenv for this project…
Using /usr/local/bin/python3 to create virtualenv…
⠋Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/loke/.virtualenvs/loke-WdDiAoi-/bin/python3.6
Also creating executable in /Users/loke/.virtualenvs/loke-WdDiAoi-/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /Users/loke/.virtualenvs/loke-WdDiAoi-
 ~/P/mpx-python-api    pipenv --where                                                                       (4s 524ms)
/Users/loke
 ~/P/mpx-python-api   
Describe your environment
  1. OS Type macOS High Sierra
  2. Python version: $ python -V Python 2.7.14 (default) Python 3.6.3 (python3)
  3. Pipenv version: $ pipenv --version pipenv, version 8.3.2 (installed via brew)
Expected result

I expected a virtualenv be created for the path /Users/loke/Projects/mpx-python-api

Actual result

A virtualenv was created for /Users/loke

Steps to replicate

Simply create the virtualenv with pipenv

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

58reactions
mtt2pcommented, Nov 20, 2017

remove the Pipfile from your home directory like mv ~/Pipfile* /tmp

32reactions
erinxoconcommented, Nov 21, 2017

Hi @colde, do you have a pipfile anywhere above that folder in your directory structure. Pipenv will search up through the directory tree for a pipfile and use that as the project root. If you remove it, you should be able to create a venv for that directory. If this isn’t the case let me know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Frequently Encountered Pipenv Problems - Read the Docs
Uninstall all existing Pipenv installations, and see ☤ Installing Pipenv to choose one of the recommended way to install Pipenv instead. ☤ My...
Read more >
Why is pipenv telling me the wrong version of python?
1 Answer 1 · The virtualenv is stored globally with the name of the project's root directory plus the hash of the full...
Read more >
Common Pipenv Errors - Towards Data Science
Pipenv manages dependencies on a per-project basis, so it is best to use Pipenv within your project directory.
Read more >
Configure a Pipenv environment | PyCharm Documentation
Open any directory with your source files that contains the Pipenv file: select File | Open from the main menu and choose the...
Read more >
Advanced Usage of Pipenv — pipenv 11.7.2 documentation
To use Pipenv with a Conda–provided Python, you simply provide the path to the ... 5/5 — 00:00:03 To activate this project's virtualenv,...
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