Pipenv错误“解释器错误:没有这样的文件或目录”

时间:2019-04-03 15:53:11

标签: python path pipenv pyenv

我正在尝试从pipfile安装要求,但是当我键入pipenv并按Enter键时,我收到此错误消息-bash: /Users/jkelly/.local/bin/pipenv: /usr/local/Cellar/python/3.7.0/bin/python3.7: bad interpreter: No such file or directory这个python目录不存在。我无法执行pipenv。

python --version返回Python 3.6.6。我用pyenv管理我所有的python版本。

这是我所有的pyenv垫片的完整列表

/Users/jkelly/.pyenv/shims/2to3
/Users/jkelly/.pyenv/shims/2to3-3.6
/Users/jkelly/.pyenv/shims/easy_install
/Users/jkelly/.pyenv/shims/easy_install-3.6
/Users/jkelly/.pyenv/shims/idle
/Users/jkelly/.pyenv/shims/idle3
/Users/jkelly/.pyenv/shims/idle3.6
/Users/jkelly/.pyenv/shims/pip
/Users/jkelly/.pyenv/shims/pip3
/Users/jkelly/.pyenv/shims/pip3.6
/Users/jkelly/.pyenv/shims/pydoc
/Users/jkelly/.pyenv/shims/pydoc3
/Users/jkelly/.pyenv/shims/pydoc3.6
/Users/jkelly/.pyenv/shims/python
/Users/jkelly/.pyenv/shims/python-config
/Users/jkelly/.pyenv/shims/python3
/Users/jkelly/.pyenv/shims/python3-config
/Users/jkelly/.pyenv/shims/python3.6
/Users/jkelly/.pyenv/shims/python3.6-config
/Users/jkelly/.pyenv/shims/python3.6m
/Users/jkelly/.pyenv/shims/python3.6m-config
/Users/jkelly/.pyenv/shims/pyvenv
/Users/jkelly/.pyenv/shims/pyvenv-3.6

pipenv是通过pipsi安装的。该错误似乎与Pipfile没有关系。我必须在某处配置了错误的路径。

export PATH=/Users/jkelly/.local/bin:$PATH
export PYENV_SHELL=bash
eval "$(pyenv init -)"
export PATH="/usr/local/opt/mongodb@3.6/bin:$PATH"
export PATH="/usr/local/opt/node@6/bin:$PATH"
export PATH="/usr/local/opt/gettext/bin:$PATH"

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

2 个答案:

答案 0 :(得分:3)

在Mac OSX上,我通过这样做解决了

brew install --force pipenv

然后

brew link --overwrite pipenv

进行重新安装。

答案 1 :(得分:1)

结果是我的Mac上有两个版本的pipenv。我同时卸载了两者,并重新安装了brew。瞧!

pip3 uninstall pipenv
brew uninstall pipenv
brew install pipenv

现在一切正常。