pip install jupyter

时间:2017-08-03 22:50:25

标签: jupyter-notebook jupyter

在尝试安装jupyter的许多不同方法之后,它似乎无法正确安装。

根据我最近有多少MacOS系统python问题

,可能与MacOS有关

pip install jupyter --user

似乎安装正确

但是找不到jupyter

where jupyter jupyter not found

未找到

尝试在SO

上找到另一种安装方法

pip install --upgrade notebook

似乎安装正确

仍未找到jupyter

where pip /usr/local/bin/pip

如何让命令行jupyter notebook命令在此处的第一步中运行,我该怎么做:https://jupyter.readthedocs.io/en/latest/running.html#running

4 个答案:

答案 0 :(得分:4)

简短答案:使用python -m notebook

在更新到Catalina操作系统后,我安装了酿造的python:brew install python。 它符号链接Python3,但不链接python命令,因此我在$PATH变量中添加了以下内容:

/usr/local/opt/python/libexec/bin

将brew python设置为默认的python命令(不要使用系统python,现在不建议使用python2.7)。 python -m pip install jupyter有效,我可以在~/Library/Python/3.7/bin/中找到jupyter文件,但是jupyter notebook的教程命令不起作用。相反,我只是运行python -m notebook

答案 1 :(得分:2)

我的MacOS具有python 2.7,我用 brew 安装了python3,然后以下命令对我有用

brew install python3

brew link --overwrite python
pip3 install ipython

python3 -m pip install jupyter

答案 2 :(得分:1)

您需要将本地python安装目录添加到您的路径。显然,这在MacOS上默认是不执行的。

尝试:

export PATH="$HOME/Library/Python/<version number>/bin:$PATH"

和/或将其添加到您的~/.bashrc

答案 3 :(得分:0)

尝试用Conda或诗歌来解决这个问题。

Poetry使管理Python依赖项(包括Jupyter)和构建虚拟环境变得容易得多。

以下是将Jupyter添加到项目中的步骤:

  • 运行poetry add pandas jupyter ipykernel添加依赖项
  • 运行poetry shell在虚拟环境中创建一个外壳程序
  • 运行jupyter notebook来启动一个可以访问所有虚拟环境依赖项的笔记本

blog post详细介绍了工作流程。

其他建议的解决方案只是创可贴。 Conda / Poetry可以为您提供可持续的解决方案,该解决方案易于维护,并且可以使您免受不断依赖Python的困扰。