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

Ubuntu只是说命令没有找到。与ipython类似。pip没有安装好还是怎么了?Ubuntu如何知道在哪里寻找安装了pip的可执行文件?


当前回答

在MacOs上,这对我来说很管用:

/Users/`userName`/opt/anaconda3/bin/jupyter_mac.command

其他回答

以下是我在Linux mint 19上所做的:

我安装jupyter与:

pip install jupyter

和命令:

jupyter notebook

没有工作,所以:

sudo apt install jupyter-notebook

我解决了这个问题,jupyter笔记本工作了。

我都试过了,

pip install jupyter

and

pip3 install jupyter

但最后还是用

sudo -H pip install jupyter

以另一个用户-H执行命令

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

任何人寻找运行的jupyter作为sudo,当jupyter安装virtualenv(没有sudo) -这为我工作:

首先验证这是一个PATH问题:

检查jupyter返回的路径是否被sudo用户覆盖:

sudo env | grep ^PATH

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

如果它没有覆盖-添加一个软链接从它覆盖的路径之一。为例:

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

现在你应该能够运行:

sudo jupyter notebook

如果jupyter运行此命令:

~/.local/bin/jupyter-notebook

只需在终端中运行此命令

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

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