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==2018.11.26' distribution was not found #4019

Closed
joanap opened this issue Nov 12, 2019 · 7 comments
Closed

pipenv==2018.11.26' distribution was not found #4019

joanap opened this issue Nov 12, 2019 · 7 comments
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Status: Needs More Information This issue does not provide enough information to take further action.

Comments

@joanap
Copy link

joanap commented Nov 12, 2019

Hello,

I used pipenv to create python virtual environments but it is not working anymore. When I run pipenv --version it outputs the message below.
I uninstalled it already and installed a clean version with homebrew but nothing has changed.
Do we know how to solve this issue?

Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/bin/pipenv", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/Users/joana.pinto/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pipenv==2018.11.26' distribution was not found and is required by the application
@frostming
Copy link
Contributor

Check your path setting, you made pyenv's python take precedence over the brew one.

@frostming frostming added Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Status: Needs More Information This issue does not provide enough information to take further action. labels Nov 12, 2019
@joanap
Copy link
Author

joanap commented Nov 12, 2019

I want to use the python from pyenv.

Output of the echo $PATH command:
/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

@hanpeter
Copy link

hanpeter commented Nov 13, 2019

@joanap, I run into the same issue every now and then. Never got a chance to dig deep in to why this is happening. Every time I ran into this error, I find $ brew reinstall pipenv fixes the issue. You can probably try that to unblock yourself.

I am not exactly sure whether this is Pipenv's issue or Homebrew's.

@joanap
Copy link
Author

joanap commented Nov 14, 2019

@hanpeter I would like to be able to install several Python versions with pyenv and create virtual environments with pipenv. I already tried reinstall and uninstall pipenv with brew but the error persists.

Here are some variables:
$ echo $PATH
/Users/joana.pinto/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I realised pipenv installed with brew it is not inside pyenv
$ which pipenv
/usr/local/bin/pipenv

$ which pyenv
/usr/local/bin/pyenv

$ which python
/Users/joana.pinto/.pyenv/shims/python

@hanpeter
Copy link

@joanap, your stack trace says your pipenv executable is coming from Homebrew's cellar. That is very confusing to me. If you want to use pyenv's python, wouldn't you just do $ pip install pipenv in the virtual environment created by pyenv?

In my current set up, I installed pipenv and pyenv from Homebrew. I have multiple version of python via pyenv. When I want to create a virtual environment using a version of python, I do $ pipenv --python X.Y.Z. Sure, my pipenv lives on my system rather than within a virtual environment, but I trust Homebrew to handle that properly. I believe this set up gives you what you are looking for.

Alternatively, I believe you can set a global version in your pyenv then install pipenv via pip in that version. Then you should be able to do the same as above, if you are in the global version. In other words, if you have Python 3.6 and 3.7 installed and use 3.6 as the global version, you should be able to do $ pipenv --python 3.7 as long as you are currently using the 3.6 version.

Hope that clarifies what you are looking for.

@AlJohri
Copy link
Contributor

AlJohri commented Nov 19, 2019

I think this is the same as #4013

@dorthrithil
Copy link

I ran into the exact same issue right after reinstalling node with brew. brew reinstall pipenv fixed the issue for me, as described by @hanpeter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. Status: Needs More Information This issue does not provide enough information to take further action.
Projects
None yet
Development

No branches or pull requests

6 participants