bash IPython 3.5 返回“错误的解释器:没有这样的文件或目录”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43701835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IPython 3.5 returns "bad interpreter: No such file or directory"
提问by codyc4321
I am getting random error while trying to use IPython. I now suddenly cannot use iPython3 with no explanation, I don't remember installing anything heavy besides Ethereum client and I didn't download the hashes or anything. Suddenly I get:
尝试使用 IPython 时出现随机错误。我现在突然无法毫无解释地使用 iPython3,我不记得除了以太坊客户端之外没有安装任何繁重的东西,而且我没有下载哈希或任何东西。突然我得到:
cchilders:~
$ ipython3
-bash: /usr/local/bin/ipython3: /usr/local/opt/python3/bin/python3.5: bad interpreter: No such file or directory
neither IPython or IPython3 was working. After uninstalling and reinstalling Python and Python3, I can now use IPython. But the same error from before happens if I try iPython3.
IPython 或 IPython3 都没有工作。卸载并重新安装 Python 和 Python3 后,我现在可以使用 IPython。但是如果我尝试 iPython3,就会发生与之前相同的错误。
This is one of the more absurd errors I've seen because I've reinstalled IPython, Python itself, and Python3 with no change.
这是我见过的最荒谬的错误之一,因为我重新安装了 IPython、Python 本身和 Python3,没有任何变化。
回答by Floyd
As described here, the problem is that ipython3 is trying to use the python3.5 kernel in /usr/local/opt/python3/bin/python3.5
. You can view which kernel ipython3 is trying to use by running:
如上所述这里,问题是,ipython3试图使用在python3.5内核/usr/local/opt/python3/bin/python3.5
。您可以通过运行来查看 ipython3 正在尝试使用哪个内核:
jupyter kernelspec list
and then viewing the kernel.json
file which is in the python3 kernel's path (in my case, the path to kernel.json is: /usr/local/share/jupyter/kernels/python3/kernel.json
).
然后查看kernel.json
python3内核路径中的文件(在我的例子中,kernel.json的路径是:)/usr/local/share/jupyter/kernels/python3/kernel.json
。
To solve this, I had to reinstall all of the following jupyter packages:
为了解决这个问题,我必须重新安装以下所有 jupyter 包:
$ pip3 uninstall jupyter jupyter-client jupyter-console jupyter-core
$ pip3 install jupyter jupyter-client jupyter-console jupyter-core
回答by unstablerealtiy
If you are not a Jupyter user, this can be solved by reinstalling ipython
如果您不是 Jupyter 用户,可以通过重新安装 ipython 解决此问题
pip uninstall ipython
pip install ipython
I found that I needed sudo
to uninstall it due to some additional errors. You may not need it.
我发现sudo
由于一些其他错误,我需要卸载它。你可能不需要它。