【问题标题】:jupyter notebook installation issue using pip使用 pip 的 jupyter notebook 安装问题
【发布时间】:2018-06-29 06:15:37
【问题描述】:

我在使用 jupyter 笔记本时遇到了问题。每次我启动笔记本时,内核都会死掉。

所以,我决定使用 pip 卸载 jupyter notebook:

pip uninstall jupyter notebook

卸载成功后,我再次安装,使用相同的pip:

pip install jupyter notebook

然后,像往常一样,我输入了 cmd:

jupyter notebook

但是得到了这个错误:

'jupyter' 未被识别为内部或外部命令, 可运行的程序或批处理文件。

所以我检查了 IPython 的位置,发现现在我要调用的正确文件是 jupyter-notebook,它与 jupyter notebook 不同破折号。如果我从 cmd 运行 jupyter-notebook 一切正常。

谁能解释一下,发生了什么以及为什么该文件现在称为 jupyter-notebook?

谢谢

【问题讨论】:

  • @SuatAtanPhD 结果相同。我只是好奇为什么语法会改变。

标签: python path jupyter-notebook


【解决方案1】:

因为 pip 使用的是旧版 Python 2。 使用pip3安装:

pip3 install --upgrade pip
pip3 install jupyter
jupyter notebook  #to start jupyter notebook

我强烈推荐安装 Anaconda。 下载 Anaconda here.

然后使用:

bash 

安装它。

祝你好运。

【讨论】:

  • 只是补充,如果您要重新安装jupyter notebook,请务必先卸载pip3 uninstall jupyter notebook。然后pip3 install jupyter notebook。这对我来说适用于最新版本。
【解决方案2】:

不安装 Anaconda 或 conda 的解决方案:

sudo easy_install pip==20.3.4
pip2 install virtualenv
virtualenv jupyter
source jupyter/bin/activate
pip2 install jupyter
jupyter notebook

此解决方案已在以下平台测试:
发行商 ID:Ubuntu
说明:Ubuntu 16.04.7 LTS
发布:16.04
代号:xenial

它在 32 位 Chromenotebook 上运行,在 xenial 上安装了 Firefox vs NetSurf

Jupyter notebook 会自动打开。但是,每次再次登录 Jupiter 时,首先需要激活源:

source jupyter/bin/activate

然后:

jupyter notebook

开始

【讨论】:

    【解决方案3】:

    我建议您始终使用 conda 而不是 pip 来安装 Jupyter Notebook。 例如,在您的情况下,我会推荐:

    conda install jupyter notebook 
    

    而不是 pip install jupyter notebook 我可以看到您描述的大多数问题都与环境相关,因此您在使用 pip 安装 jupyter 时经常会遇到环境问题

    【讨论】: