简体   繁体   English

错误的解释器:运行 pip 时没有这样的文件或目录

[英]bad interpreter: No such file or directory when running pip

Whenever I try to run pip (with or without any of the options) I get something like this:每当我尝试运行 pip (有或没有任何选项)时,我都会得到这样的结果:

$ pip --version
/usr/local/Cellar/pyenv/1.2.16/pyenv.d/exec/pip-rehash/pip: /Library/Frameworks/Python.framework/Versions/3.7/bin/pip: /usr/local/bin/python3: bad interpreter: No such file or directory

Running which pip however, returns me /Users/jalee/.pyenv/shims/pip which is an expected behaviour.然而,运行which pip返回/Users/jalee/.pyenv/shims/pip这是预期的行为。

Not sure why this is happening不知道为什么会这样

python3 -c "print('working')" python3 -c "打印('工作')"

print working just fine打印working正常

I solved this problem by using pip instead of pip3 .我通过使用pip而不是pip3解决了这个问题。

"bad interpreter: No such file or directory" “错误的解释器:没有这样的文件或目录”

seems to mean that a wrong (not bad) interpreter is being used to interpret a Python file.似乎意味着使用错误(不错)的解释器来解释 Python 文件。

In my case, it seems that I was trying to install a Python 2 program with a Python 3 installer.就我而言,似乎我试图用 Python 3 安装程序安装 Python 2 程序。 In your case, it looks like you are trying to use a Python 2 version of pip, which processes Python 2 files, to install a Python 3 file.在您的情况下,您似乎正在尝试使用 Python 2 版本的 pip(它处理 Python 2 文件)来安装 Python 3 文件。

Your submission indicates that your pip (which may be intended for Python 2) is associated with a Python 3 interpreter.您提交的内容表明您的 pip(可能适用于 Python 2)与 Python 3 解释器相关联。 Perhaps you might try uninstalling pip then reinstall it making sure that you get the Python 3 version.也许您可以尝试卸载 pip 然后重新安装它以确保您获得 Python 3 版本。

I am currently using miniconda 3 which provides both pip and pip3 .我目前正在使用 miniconda 3,它提供pippip3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 pip: "/Volumes/HD: bad interpreter: 没有那个文件或目录 - pip: "/Volumes/HD: bad interpreter: No such file or directory Python / pip错误的解释器:没有这样的文件或目录 - Python/pip bad interpreter : no such file or directory pip3:错误的解释器:没有这样的文件或目录 - pip3: bad interpreter: No such file or directory pip install flask导致解释器错误:没有这样的文件或目录 - pip install flask results in bad interpreter: No such file or directory 错误的解释器:没有这样的文件或目录 - Bad interpreter: No such file or directory Python:运行 django-admin.py 时出现“错误解释器:没有这样的文件或目录” - Python: “bad interpreter: No such file or directory” when running django-admin.py 在 ubuntu 16.04 中安装 pip 后出现错误“/usr/bin/python3.9: bad interpreter: No such file or directory” - Getting error “/usr/bin/python3.9: bad interpreter: No such file or directory” after installing pip in ubuntu 16.04 pip安装/usr/local/opt/python/bin/python2.7:错误的解释器:没有这样的文件或目录 - pip installation /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory 运行烧瓶命令时找不到错误的解释器文件错误 - Bad interpreter file not found error when running flask commands IPython 3.5 返回“错误的解释器:没有这样的文件或目录” - IPython 3.5 returns “bad interpreter: No such file or directory”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM