5

I am trying to install pipenv using Homebrew as suggested in here.

First, I ran $ brew install pipenv. Then, brew install python 3.7 automatically and I can use pipenv properly. But, I want to use pipenv on Python 3.6, so I ran $ brew switch python 3.7 3.6.5 and then when I tried $ pipenv install an error appeared as follow:

dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /usr/local/Cellar/pipenv/2018.11.26/libexec/bin/python3.7
  Reason: image not found
Abort trap: 6

Is there any solution to install pipenv along with Python 3.6.5?

Thank you.

Satrio Adi Prabowo
  • 570
  • 1
  • 4
  • 13

5 Answers5

7

I had the same issue and spent a long time researching. In the end I determined my project did not absolutely need python3.6 so I switched brew to python3.7 and reinstalled pipenv.

If you absolutely need to use pipenv with python3.6 then you may find this thread helpful but to me it seemed like a nuclear option I didn't want to go through.

How to move back to using pipenv with python3.7:

# get your version of python3.7
brew list --versions python

# switch to your python3.7 version
brew switch python 3.7.x_x 

# install pipenv if it was removed during the troubleshooting process
brew install pipenv

# pipenv should work now
pipenv --help
gavinest
  • 308
  • 2
  • 12
2

Try this, but first install python 3.6.5

pipenv --python 3.6.5
Alex
  • 615
  • 8
  • 26
  • This was the only solution that worked with me , my case was "pipenv install" raising the same above error, it seems pipeline was targeting the wrong python framework – 0xFK Sep 15 '20 at 09:48
1

You can always install using your specific Python using pip:

python3 -m pip install --user pipenv

python3, here assumes your 3.6.5, if not then use the whole path to your desired Python.

Prayson W. Daniel
  • 14,191
  • 4
  • 51
  • 57
1

https://github.com/pypa/pipenv/issues/2965

Make sure you're using python3.6

$ python
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

$ brew switch python # if not, see your versions
Error: Usage: brew switch <formula> <version>
python installed versions: 3.6.5_1, 3.7.3

$ brew switch python 3.6.5_1 # change your version if is necessary
Cleaning /usr/local/Cellar/python/3.6.5_1
Cleaning /usr/local/Cellar/python/3.7.3
25 links created for /usr/local/Cellar/python/3.6.5_1

Install pipenv 2018.6.25

$ brew unlink pipenv
$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/2c0bbfa297e2429cd6e080ad5231f3aa56ff4f65/Formula/pipenv.rb

Change to pipenv 2018.6.25

$ brew switch pipenv 2018.6.25
0

Had the same issue after upgrading OSX version.

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

brew uninstall pipenv
pip install --user pipenv

If you get pipenv: command not found, add the user base’s binary directory to your PATH per the instructions, for OSX add this to your ~/.bash_profile:

export PATH=/Users/YOUR_USER_NAME/.local/bin:$PATH
Dodge
  • 3,219
  • 3
  • 19
  • 38