用pip安装后,“jupyter:command not found”

时间:2016-02-10 11:25:30

标签: ubuntu pip jupyter

使用pip install jupyter安装后,终端仍无法找到jupyter notebook

Ubuntu只是说command not found。与ipython类似。 pip没有正确安装或其他什么? Ubuntu如何知道在哪里查找使用pip安装的可执行文件?

25 个答案:

答案 0 :(得分:93)

您没有退出并登录?它应该在您的执行路径上。 如果没有,请在.local中安装已安装的可执行文件,因此在终端中:

 ~/.local/bin/jupyter-notebook

应该启动笔记本

答案 1 :(得分:49)

为了能够从终端运行jupyter notebook,您需要确保~/.local/bin在您的路径中。

通过为当前会话运行export PATH=$PATH:~/.local/bin或将该行添加到~/.bashrc的末尾,以便在将来的会话中进行更改(例如,使用nano ~/.bashrc)来执行此操作。如果您编辑〜/ .bashrc,则需要注销并重新登录才能使更改生效。

答案 2 :(得分:22)

尝试

python -m notebook

或者,如果您使用pip3安装笔记本:

python3 -m notebook

在Mac OS Catalina和酝酿的Python3.7上

答案 3 :(得分:19)

在终端

中执行此操作
export PATH=~/anaconda3/bin:$PATH

在Ubuntu 16.10,Python3,Anaconda3上为我工作

<强>更新

在〜/ .bashrc或〜/ .zshrc中添加路径(如果你使用的是zsh bash)文件

vi ~/.bashrc

将以下行添加到文件

PATH=~/path/to/anaconda:$PATH

使用

关闭文件
esc + : + wq

答案 4 :(得分:13)

我试过了两个,

pip install jupyter

pip3 install jupyter

但终于使用

完成了它
sudo -H pip install jupyter

答案 5 :(得分:7)

在Mac OS上,您需要在~/.local/bin变量中导出$PATH

# Edit the bash profile:
$ vim ~/.bash_profile

# Add this line inside ~/.bash_profile:
export PATH=$PATH:~/.local/bin

# Update the source:
$ source ~/.bash_profile

# Open Jupyter:
$ jupyter notebook

答案 6 :(得分:5)

  • 使用Ctrl + Alt + T打开终端窗口。

  • 运行命令gedit~ / .profile。

  • 添加该行。 export PATH = $ PATH:/。local / bin / jupyter-notebook。到底并保存。

  • 退出并重新登录。

希望这会奏效。

答案 7 :(得分:4)

尝试&#34; pip3安装jupyter&#34;而不是pip。它对我有用。

答案 8 :(得分:4)

在Mac Os High Sierra上,我使用以下命令安装了jupyter

python3 -m pip install jupyter    

然后,将二进制文件安装在:

/Library/Frameworks/Python.framework/Versions/3.6/bin/jupyter-notebook

答案 9 :(得分:2)

这是我在Linux Mint 19上所做的事情:

我用以下命令安装了jupyter:

pip install jupyter

和命令:

jupyter notebook

不起作用,因此:

sudo apt install jupyter-notebook

我已解决问题,jupyter notebook随后开始工作。

答案 10 :(得分:1)

在Ubuntu上安装Jupyter Notebook后,出现以下错误:

异常:未找到Jupyter命令'jupyter-notebook'。

我使用了简单的命令,它对我有用

  

pip install --upgrade --force-reinstall --no-cache-dir jupyter

来源:http://commandstech.com/how-to-install-jupyter-on-ubuntu16-04-with-pictures-commands-errors-solution/

从root用户退出后,然后执行:

  

jupyter笔记本

答案 11 :(得分:1)

唯一有效的方法是将与pip3相关的Python版本导出到PATH :)(经过很多努力) 只需运行:

which pip3

您应该得到类似的东西(在Mac中):

/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3

现在运行:

export PATH=/Library/Python/3.6/bin:$PATH

如果它对您有用:)只需将其添加到您的 bashrczshrc

答案 12 :(得分:1)

如果jupyter运行此命令:

~/.local/bin/jupyter-notebook

只需在终端

中运行此命令即可
 export PATH=~/.local/bin:$PATH

答案 13 :(得分:0)

现在是2020年。 使用Mac在我身边解决此问题: pip install jupyterlab代替pip install jupyter。 成功安装关键字之前会出现警告: enter image description here

您可以使用jupyterlab查看路径 那么您只需要按照以下路径启动jupyter笔记本即可:

jupyter-lab

笔记本将由您的默认浏览器自动加载。

答案 14 :(得分:0)

如果您在虚拟环境中,请运行以下命令:

conda install jupyter

答案 15 :(得分:0)

pip install --user --upgrade jupyter

使用上述命令应该可以在Ubuntu 18.04中完成工作

如果没有,请按照here

中的步骤进行操作。

答案 16 :(得分:0)

就我而言,jupyter-notebook <name of the notebook>有效

答案 17 :(得分:0)

安装 jupyterlab。

如果您收到此错误:

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

requests 2.25.1 requires idna<3,>=2.5, but you'll have idna 3.1 which is incompatible.

使用这个:

pip3 install jupyterlab --use-feature=2020-resolver

答案 18 :(得分:0)

任何人都希望在使用virtualenv安装jupyter(不使用sudo)时以sudo的形式运行jupyter-这对我有用:

首先确认这是PATH问题:

检查Try this: You are not adding third Column. <div class="container"> <div class="row"> <div class="col-md-4 col-xs-12"> 1 </div> <div class="col-md-8 col-xs-12"> <div class="col-md-12"> <div class="col-md-2"> 2.1 </div> <div class="col-md-10"> <div class="col-md-12"> 2.21 </div> <div class="col-md-12"> 2.22 </div> </div> </div> </div> <div class="col-md-4 col-xs-12"> <div class="col-md-12"> <div class="col-md-2"> 3.1 </div> <div class="col-md-10"> <div class="col-md-12"> 3.21 </div> <div class="col-md-12"> 3.22 </div> </div> </div> </div> </div> </div> 返回的路径是否被sudo用户覆盖:

which jupyter

(相对于当前用户:sudo env | grep ^PATH

如果未覆盖,请在其上添加一条软链接到其中一条路径。例如:

env | grep ^PATH

现在您可以运行:

sudo ln -s /home/user/venv/bin/jupyter /usr/local/bin

答案 19 :(得分:0)

我使用以下命令从源代码编译了python3.7

./configure --prefix=/opt/python3.7.4 --with-ssl
make
make install

pip3.7 install jupyter之后,我发现可执行文件在/opt/python3.7.4/bin

Missing sqlite3 after Python3 compile处查看我的答案,以获取在ubuntu14.04下编译python3.7和pip的更多详细信息

答案 20 :(得分:0)

这是它对我的工作方式 使用pip安装jupyter后,其路径位于

  

/ usr / local / bin

所以要运行我刚刚在终端中键入的jupyter笔记本,

  

jupyter-notebook

它对我来说是有效的,我使用的是鹦鹉操作系统,并使用pip3安装了jupyter

答案 21 :(得分:0)

大多数情况下(如果jupyter不在/ local / bin中),

which jupyter

示例输出

~/miniconda3/bin/jupyter

查看jupyter的路径,然后在sudo中明确使用该路径

sudo ~/miniconda3/bin/jupyter 

答案 22 :(得分:0)

我使用的是python 2.7的Mojave,在pip install --user jupyter之后,二进制文件移到了这里:

/Users/me/Library/Python//2.7/bin/jupyter

答案 23 :(得分:0)

我必须跑步&#34; rehash&#34;然后它就能找到jupyter命令

答案 24 :(得分:0)

如果您使用&#39; pip&#39;安装了适用于Python 2的Jupyter笔记本电脑。而不是&#39; pip3&#39;它可能会运行:

ipython notebook