在 Python 3.6 上使用 brew 安装 pipenv

Sat*_*owo 4 python homebrew pipenv

我正在尝试按照此处的建议使用 Homebrew 安装 pipenv 。

首先,我跑了$ brew install pipenv。然后, brew install python 3.7 自动,我可以正确使用pipenv。但是,我想在 Python 3.6 上使用 pipenv,所以我跑了$ brew switch python 3.7 3.6.5,然后当我尝试时$ pipenv install出现如下错误:

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
Run Code Online (Sandbox Code Playgroud)

是否有任何解决方案可以将 pipenv 与 Python 3.6.5 一起安装?

谢谢你。

gav*_*est 7

我有同样的问题,并花了很长时间研究。最后我确定我的项目并不是绝对需要,python3.6所以我切换到 brewpython3.7并重新安装了pipenv.

如果你绝对需要使用pipenvwithpython3.6那么你可能会发现这个线程有帮助但对我来说这似乎是我不想经历的核选项。

如何重新使用pipenvwith 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
Run Code Online (Sandbox Code Playgroud)


Pra*_*iel 1

您始终可以使用 pip 使用特定的 Python 进行安装:

python3 -m pip install --user pipenv
Run Code Online (Sandbox Code Playgroud)

python3,这里假设您的版本是 3.6.5,如果不是,则使用您所需的 Python 的完整路径。