【问题标题】:Just updated Ubuntu to 22.04, now I can't open Jupyter Notebook刚刚将 Ubuntu 更新到 22.04,现在我无法打开 Jupyter Notebook
【发布时间】:2022-06-22 04:41:08
【问题描述】:

当我尝试启动 Jupyter Notebook 时,浏览器启动并出现以下错误:

Access to the file was denied

The file at /home/benjamin/.local/share/jupyter/runtime/nbserver-11758-open.html is not readable.

It may have been removed, moved, or file permissions may be preventing access.

我试过跑步

jupyter lab clean --all
pip3 install jupyterlab --force-reinstall

根据这里的建议:Jupyter Notebook: Access to the file was denied。命令运行,但我仍然收到“访问文件被拒绝”错误。此外,在重新安装命令它吐出这个:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 4.2.5 requires pyqt5<5.13, which is not installed.
spyder 4.2.5 requires pyqtwebengine<5.13, which is not installed.
conda-repo-cli 1.0.4 requires pathlib, which is not installed.
anaconda-project 0.9.1 requires ruamel-yaml, which is not installed.
spyder 4.2.5 requires jedi==0.17.2, but you have jedi 0.18.1 which is incompatible.
spyder 4.2.5 requires parso==0.7.0, but you have parso 0.8.3 which is incompatible.
sphinx 4.0.1 requires Jinja2<3.0,>=2.3, but you have jinja2 3.1.1 which is incompatible.
sphinx 4.0.1 requires MarkupSafe<2.0, but you have markupsafe 2.1.1 which is incompatible.
python-language-server 0.36.2 requires jedi<0.18.0,>=0.17.2, but you have jedi 0.18.1 which is incompatible.
fermipy 1.0.1+5.g5a57 requires astropy<4, but you have astropy 4.2.1 which is incompatible.

这可能是也可能不是问题的一部分。

在这里发帖:https://discourse.jupyter.org/t/after-updating-to-ubuntu-22-04-i-am-no-longer-able-to-access-jupyter-notebook/13991

这里:https://askubuntu.com/questions/1404330/after-updating-to-ubuntu-22-04-i-am-no-longer-able-to-access-jupyter-notebook

在 reddit 上:https://www.reddit.com/r/learnpython/comments/uaipzo/i_just_updated_my_machine_to_ubuntu_2204_now_i/

【问题讨论】:

标签: linux ubuntu jupyter-notebook updates


【解决方案1】:

你尝试设置了吗

c.NotebookApp.use_redirect_file = False

在 jupyter_notebook_configuration.py 文件中?

如果您尝试过,您是否删除了行首的“#”?

我在 Ubuntu 22.04 上遇到了同样的问题,这解决了它。

【讨论】:

  • 仍然没有运气,在我修改该文件后,我应该重新安装 jupyter 还是应该正常工作?进行您建议的更改后,我收到相同的“访问被拒绝”错误...
【解决方案2】:

更新:我现在可以使用打印到控制台的 URL 访问笔记本。 (复制粘贴到火狐浏览器即可)

我仍然想弄清楚如何使用“jupyter notebook”命令打开它,就像它在更新之前的工作方式一样,但现在这是一个有用的解决方法。

【讨论】:

  • 补充一点 - 这不是 Brave 浏览器的问题,因为更改默认设置会完美打开 Jupyter。让我直觉 Chrome 可以正常工作(虽然还没有测试过)
  • Update2:如果您特别希望在 Firefox 上打开 - 请注意,只有 snap 版本存在问题。如果您从网站安装实际的 Firefox,它会按预期工作。链接:mozilla.org/en-US
【解决方案3】:

我首先创建了文件: jupyter notebook --generate-config 然后我取消注释并按照您所说的更改 c.NotebookApp.use_redirect_file 行

现在它可以工作了!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-11
    • 2021-07-13
    • 2021-12-20
    • 1970-01-01
    • 2023-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多