Pipenv: Issue after upgrading python to 3.7

Created on 24 Aug 2018  ·  12Comments  ·  Source: pypa/pipenv

Issue description

I'm on a Mac and installed pre-commit using brew and without even asking for it got upgraded from python 3.6.5 to 3.7. (3.6.5 was also under the control of brew)

Now pipenv fails with "Library not loaded"-error.

Expected result

Pipenv to work as before the python upgrade.

Actual result
$ pipenv -h
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /usr/local/Cellar/pipenv/2018.5.18/libexec/bin/python3.6
  Reason: image not found
Abort trap: 6
Comments
  1. What's the proper way of fixing the issue? Can I edit some config-file to point to 3.7 instead?

  2. Could pipenv perhaps be more lenient and rely on the python3 binary instead of the python3.6?

Most helpful comment

I am having a similar issue - where arch linux upgraded from 3.6.5 to 3.7 and now I get an error whenever I try to run pipenv. What works for me, but it is indeed a bit of an ugly hack, is to first upgrade pip, reinstall pipenv and for every repository using pipenv, erase the virtualenvironment and recreate it.
I do something like:

rm -rf `pipenv --venv`
pipenv install --dev

and this seems to do the job.

Note: you should also probably change the requirement in the Pipfile from python 3.6 to 3.7.

I hope this helps, but I'm also wondering if there is a more robust solution...

All 12 comments

I am having a similar issue - where arch linux upgraded from 3.6.5 to 3.7 and now I get an error whenever I try to run pipenv. What works for me, but it is indeed a bit of an ugly hack, is to first upgrade pip, reinstall pipenv and for every repository using pipenv, erase the virtualenvironment and recreate it.
I do something like:

rm -rf `pipenv --venv`
pipenv install --dev

and this seems to do the job.

Note: you should also probably change the requirement in the Pipfile from python 3.6 to 3.7.

I hope this helps, but I'm also wondering if there is a more robust solution...

That is related to how Homebrew configures Python. There is nothing Pipenv (or any Python libraries) can do about it. DO NOT install things on a Homebrew Python if you don’t want this to happen. If it does, re-installing is your only option.

I remember I commented on a similar issue a few days ago, but couldn’t find it at the moment :(

@uranusjr Isn't this recommended by the docs though?

Yes, so?

Homebrew installs are kind of complicated and outside of our control, you assume some risk if you use them (neither of us uses a Mac so we really can't offer much insight on that)

what worked for me was
brew uninstall mkcert

What worked for me was just nuking all my envs: rm -rf /Users/william/.local/share/virtualenvs/*, and reinstalling envs with pipenv install.

@omrihar why the --dev flag? The docs say "Install both develop and default packages." Does this mean installing local packages (e.g. python setup.py develop)?

Edit: using brew-installed pipenv (2018.11.26_2) w/ python3.7. I was having issues at the locking phase of install, e.g. Locking Failed! or just hanging at Locking

what helped to us was:

$ brew uninstall pipenv
$ brew install python3.6
$ pip3 install --user pipenv
$ mkdir -p ~/bin
$ ln -s ../Library/Python/3.6/bin/pipenv ~/bin/

and if you didn't do so yet, add ~/bin/ to your PATH by editing the PATH line in ~/.bash_profile:

...
PATH=/Users/{your_username}/bin:{the_content_that_was_there_before}
...

Don't forget to close and open shell

I was running into this issue, and solved it by running according to the docs

brew upgrade pipenv

I ran into the same issue after upgrading OSX version.

Solved by uninstalling homebrew installation and then following the "Pragmatic Installation" instructions:

pip install --user pipenv

Don't forget to add the user base’s binary directory to your PATH per the instructions.

Hi, i'm getting the same errors, but i'm not sure what I need to uninstall and how.
I tried installing pipenv and got the errors, then saw that it wasn't installed. and looking in brew logs, I see that it seem to have installed python3.8, which AFAIK was not installed before (i'm using 3.7)

Trying to uninstall [email protected] did not work since awscli depends on it, which doesn't make sense if it wasn't installed before...

What do I generally need to uninstall to solve this issue?
the only logs in ~/Library/Logs/Homebrew are of [email protected] from the time of the installation.
it seems to me that I need to uninstall it, seems right? (maybe awscli was updated or something...)

thanks for your help.

Uninstalling python did the trick. thanks

Was this page helpful?
0 / 5 - 0 ratings