jupyter笔记本电脑错误的解释器错误消息

Ano*_*nny 5 python jupyter-notebook

我尝试将jupyter notebook与内核python3一起使用,但收到此错误消息。

anonymous$ jupyter notebook
/usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
Run Code Online (Sandbox Code Playgroud)

有关在Mac上安装的python和pip的信息(我使用pip3安装jupyter):

anonymous$ which -a python python2 python2.7 python3 python3.6
/usr/bin/python
/usr/bin/python2.7
/usr/local/bin/python3
/usr/local/bin/python3.6
anonymous$ which -a pip pip2 pip3
/usr/local/bin/pip
/usr/local/bin/pip3
Run Code Online (Sandbox Code Playgroud)

试图通过“ brew update && brew upgrade jupyter”解决该问题,如另一篇文章所建议的那样,但是没有用。得到了一条错误消息,指出“错误:未安装jupyter”。

Imr*_*ran 7

您必须已使用其他软件包管理器(例如)安装了jupyter pip。您可以尝试pip uninstall jupyter使用brew install jupyter

如果收到消息:

Error: The `brew link` step did not complete successfully 
The formula built, but is not symlinked into /usr/local 
Could not symlink bin/jupyter 
Target /usr/local/bin/jupyter already exists.
Run Code Online (Sandbox Code Playgroud)

您可以brew link --overwrite jupyter按照建议尝试。

  • brew链接--overwrite jupyter为我工作! (2认同)

小智 6

我用 pip3 重新安装了 jupyter 笔记本,当我再次启动笔记本时一切正常。

pip3 install jupyter
jupyter notebook
Run Code Online (Sandbox Code Playgroud)


小智 5

当从可能不再存在的以前的 python 版本加载 jupyter 笔记本的内核时,通常会出现此问题。

  • 跑步jupyter kernelspec list。kernel.json 包含正在使用的 python 版本的路径。您可以直接更改此路径,也可以取消 Jupyter 安装(如下所示)并重新安装。
  • 删除 Jupyter 文件夹位置(在 mac 上rm -rf /Users/<username>/Library/Jupyter/:)
  • brew uninstall jupyter; brew cleanup
  • 如果使用 pip 和 pyenv:pip install jupyterlab否则brew install jupyter