Ubuntu 在使用pip进行安装后,“;jupyter:未找到命令";

Ubuntu 在使用pip进行安装后,“;jupyter:未找到命令";,ubuntu,pip,jupyter-notebook,jupyter,Ubuntu,Pip,Jupyter Notebook,Jupyter,使用pip安装jupyter安装后,终端仍然找不到jupyter笔记本 Ubuntu只是说找不到命令。类似于ipython。pip是否未正确安装?Ubuntu如何知道在何处查找安装了pip的可执行文件?您没有注销和登录?它应该在您的路径上执行。 如果没有,pip会在.local中安装可执行文件,因此在终端中: ~/.local/bin/jupyter-notebook 应该启动笔记本电脑,才能从终端运行jupyter笔记本电脑,您需要确保~/.local/bin在您的路径中 为此,请为当前会

使用
pip安装jupyter
安装后,终端仍然找不到
jupyter笔记本


Ubuntu只是说找不到
命令
。类似于
ipython
pip
是否未正确安装?Ubuntu如何知道在何处查找安装了
pip
的可执行文件?

您没有注销和登录?它应该在您的路径上执行。 如果没有,pip会在.local中安装可执行文件,因此在终端中:

 ~/.local/bin/jupyter-notebook

应该启动笔记本电脑,才能从终端运行jupyter笔记本电脑,您需要确保
~/.local/bin
在您的路径中


为此,请为当前会话运行
export PATH=$PATH:~/.local/bin
,或将该行添加到
~/.bashrc
的末尾,使更改在未来会话中持续(例如,使用
nano~/.bashrc
)。如果编辑~/.bashrc,则需要注销并重新登录,以确保更改生效。

尝试“pip3安装jupyter”,而不是pip。它对我很有效。

在终端中执行此操作

export PATH=~/anaconda3/bin:$PATH
在Ubuntu 16.10、Python3、Anaconda3上为我工作

更新

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

将下面的行添加到文件中

PATH=~/path/to/anaconda:$PATH
用鼠标关闭文件

esc + : + wq
  • 使用Ctrl+Alt+T打开终端窗口

  • 运行命令gedit~/.profile

  • 添加行。导出路径=$PATH:/.local/bin/jupyter笔记本。到底部保存

  • 注销并再次登录

希望这能奏效。

我两个都试过了

pip install jupyter

但最终还是通过使用

sudo -H pip install jupyter
以另一个用户的身份执行命令-H


-H(HOME)选项请求安全策略将HOME环境变量设置为密码数据库指定的目标用户的主目录(默认情况下为root)。根据策略的不同,这可能是默认行为。

如果使用“pip”而不是“pip3”安装Python2的Jupyter notebook,则可以运行:

ipython notebook

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

# 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

如果jupyter通过此命令运行:

~/.local/bin/jupyter-notebook
只需在终端中运行此命令

 export PATH=~/.local/bin:$PATH

我必须运行“rehash”,然后它才能在Mac Os High Sierra上找到jupyter命令,我安装了jupyter

python3 -m pip install jupyter    
然后,二进制文件安装在:

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

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

which pip3
您应该得到类似(在Mac中)的内容:

现在运行:

export PATH=/Library/Python/3.6/bin:$PATH
如果它对你有效:)只需将它添加到你的
bashrc
zshrc

我在Mojave上使用Python 2.7,在
pip安装之后——用户jupyter
二进制文件出现在这里:

/Users/me/Library/Python//2.7/bin/jupyter
大多数情况下(如果jupyter不在/local/bin中)使用

示例输出

~/miniconda3/bin/jupyter
要查看jupyter的路径,请显式地将该路径与sudo一起使用

sudo ~/miniconda3/bin/jupyter 

这就是它对我的作用 使用pip安装jupyter后的路径位于

哪一点

/usr/本地/bin

因此,要运行jupyter笔记本,我刚刚在终端中键入:

 ~/.local/bin/jupyter-notebook
jupyter笔记本


我使用parrot操作系统并使用pip3安装了jupyter,我使用以下命令从源代码编译了python3.7

./configure --prefix=/opt/python3.7.4 --with-ssl
make
make install
pip3.7安装jupyter之后
我发现可执行文件位于
/opt/python3.7.4/bin


查看我的答案,了解更多关于ubuntu14.04下python3.7和pip的详细信息。当jupyter安装了virtualenv(没有sudo)时,任何人都希望将jupyter作为sudo运行——这对我来说很有效:

首先确认这是一个路径问题:

检查sudo用户是否覆盖了由
哪个jupyter
返回的路径:

sudo env | grep ^PATH
(与当前用户相反:
env | grep^PATH

如果它没有被覆盖-添加一个从它到其中一个被覆盖路径的软链接。例如:

sudo ln -s /home/user/venv/bin/jupyter /usr/local/bin
现在您应该能够运行:

sudo jupyter notebook

在Ubuntu上安装Jupyter笔记本后,我发现以下错误:

异常:找不到Jupyter命令“Jupyter笔记本”

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

pip安装--升级--强制重新安装--无缓存目录jupyter

资料来源:

从根用户退出后,执行:

jupyter笔记本


就我而言,
jupyter笔记本
起作用了

pip install --user --upgrade jupyter
使用上面的命令应该可以在Ubuntu 18.04中完成这项工作

如果没有,请按照

中的步骤尝试

python-m笔记本

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

python3-m笔记本


在Mac OS Catalina和Breed Python3.7上,这里是我在Linux mint 19上所做的:

我安装jupyter时使用了:

pip install jupyter
指挥部:

jupyter notebook
不起作用,因此:

sudo apt install jupyter-notebook
我解决了这个问题,
jupyter笔记本
在当时工作。

现在是2020年。 使用mac解决我身边的此问题:
pip安装jupyterlab
而不是
pip安装jupyter
。 成功安装关键字之前将出现警告:

您可以通过jupyterlab查看路径 然后,您只需按照以下路径启动jupyter笔记本:

jupyter-lab

笔记本电脑将由默认浏览器自动加载。

如果您在虚拟环境中,只需运行以下操作:

conda安装jupyter

安装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.

运行pip后,安装jupyter。确保重新启动终端,使其更新环境和主变量。这对我来说很有效

多亏了关于pip、setuptools、Jupyter和Python的糟糕文档,总体而言,我一直在为安装Jupyter笔记本而苦苦挣扎,直到我找到了这个网站- 不是s
sudo apt install jupyter-notebook
jupyter-lab
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.
# This step was not necessary on  my system, 
# because the nosnap.pref file did not exist,
# but in case it helps:
sudo rm /etc/apt/preferences.d/nosnap.pref  

sudo apt update
sudo apt install snapd

sudo snap install jupyter
jupyter notebook
python3.9 -m jupyter labextension install jupyterlab-plotly@4.14.3
sudo -H pip install jupyter