【问题标题】:IPython 3.5 returns "bad interpreter: No such file or directory"IPython 3.5 返回“错误的解释器:没有这样的文件或目录”
【发布时间】:2017-09-27 20:22:46
【问题描述】:

我在尝试使用 IPython 时遇到随机错误。我现在突然无法在没有任何解释的情况下使用 iPython3,我不记得除了以太坊客户端之外安装了任何重的东西,而且我没有下载哈希或任何东西。突然我明白了:

cchilders:~ 
$ ipython3
-bash: /usr/local/bin/ipython3: /usr/local/opt/python3/bin/python3.5: bad interpreter: No such file or directory

IPython 或 IPython3 都没有工作。卸载并重新安装 Python 和 Python3 后,我现在可以使用 IPython。但是,如果我尝试 iPython3,就会出现与之前相同的错误。

这是我见过的最荒谬的错误之一,因为我重新安装了 IPython、Python 本身和 Python3,没有任何变化。

【问题讨论】:

  • 你解决过这个问题吗?
  • 我想我刚开始重新安装东西直到它起作用

标签: python bash macos ipython


【解决方案1】:

here 所述,问题在于ipython3 正在尝试使用/usr/local/opt/python3/bin/python3.5 中的python3.5 内核。您可以通过运行查看 ipython3 正在尝试使用哪个内核:

jupyter kernelspec list

然后查看python3内核路径中的kernel.json文件(在我的例子中,kernel.json的路径是:/usr/local/share/jupyter/kernels/python3/kernel.json)。

为了解决这个问题,我不得不重新安装以下所有 jupyter 包:

$ pip3 uninstall jupyter jupyter-client jupyter-console jupyter-core
$ pip3 install jupyter jupyter-client jupyter-console jupyter-core

【讨论】:

  • 我在网上遇到的最完整、最清晰的答案。 +1!
  • 我在使用python 层启动 Spacemacs 时遇到了问题中描述的错误。我没有安装jupyter,运行第二个命令为我解决了这个问题。
  • 没有为我解决问题。我仍然收到bash: /home/user/.local/bin/ipython: /usr/local/bin/python: bad interpreter: No such file or directory 错误。
【解决方案2】:

如果你不是 Jupyter 用户,这可以通过重新安装 ipython 来解决

pip uninstall ipython
pip install ipython

由于一些额外的错误,我发现我需要sudo 来卸载它。你可能不需要它。

【讨论】:

    【解决方案3】:

    对我来说,调用了错误版本的 jupyter。刚打Jupiter的时候,是找3.7下安装的,其实是安装在3.8目录下的。

    卸载和重新安装对我没有帮助。相反,我必须给出 Jupiter 3.8 版本的绝对路径才能克服这个错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-15
      • 2016-10-18
      • 1970-01-01
      • 2012-03-07
      • 1970-01-01
      • 1970-01-01
      • 2021-02-25
      相关资源
      最近更新 更多