Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipenv chooses wrong project path #1102

Closed
colde opened this issue Nov 20, 2017 · 7 comments
Closed

Pipenv chooses wrong project path #1102

colde opened this issue Nov 20, 2017 · 7 comments

Comments

@colde
Copy link

colde commented Nov 20, 2017

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

@mtt2p
Copy link

mtt2p commented Nov 20, 2017

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

@erinxocon
Copy link
Contributor

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!

@dangelsaurus
Copy link

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!

but why?

@hess8
Copy link

hess8 commented Nov 21, 2019

Thanks for the help!

@brennenhuang
Copy link

help me a lot, thank you.

@noelmcloughlin
Copy link

I had to do this.

 rm $(find ~/ | grep Pipfile)
 rm -fr ~/.local
 pip3 install --user pipenv

@snachman
Copy link

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

THANK YOU!!!! This was it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants