刚将Ubuntu更新为22.04,现在我可以打开Jupyter笔记本

发布于 2025-01-23 10:22:46 字数 2824 浏览 2 评论 0 原文

当我尝试启动jupyter笔记本时,浏览器会启动,我会收到以下错误:

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笔记本:对文件的访问被拒绝。命令运行,但我仍然可以拒绝对文件的访问。另外,在重新安装命令上,它会吐出:

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-totation-to-to-to-wobuntu-22-04-i-i-i--------------------------------------------------------i-am-am-no-longer-able-to-access-jupyter-jupyter--笔记本/13991

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

and在reddit上:

When I try to launch Jupyter Notebook, the browser launches and I get the following error:

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.

I tried running

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

as per the suggestion from here: Jupyter Notebook: Access to the file was denied. The commands ran, but I still get the Access to the file was denied error. Also, on the reinstall command it spits this out:

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.

which may or may not be part of the problem.

Cross posted here: https://discourse.jupyter.org/t/after-updating-to-ubuntu-22-04-i-am-no-longer-able-to-access-jupyter-notebook/13991

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

and on reddit: https://www.reddit.com/r/learnpython/comments/uaipzo/i_just_updated_my_machine_to_ubuntu_2204_now_i/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

乖乖 2025-01-30 10:22:46

您是否尝试

c.NotebookApp.use_redirect_file = False

在jupyter_notebook_configuration.py文件中设置?

如果您尝试过,您是否在行开始时删除了“#”?

我对Ubuntu 22.04遇到了同样的问题,并将其修复了。

did you try setting

c.NotebookApp.use_redirect_file = False

In the jupyter_notebook_configuration.py file?

If you tried, did you remove the '#' at the start of the line?

I had the same problem with Ubuntu 22.04 and this fixed it.

一桥轻雨一伞开 2025-01-30 10:22:46

更新:我现在可以使用打印到控制台的URL立即访问笔记本。 (只需将其复制并粘贴到Firefox浏览器中)

我仍然想弄清楚如何仅使用“ Jupyter Notebook”打开它。 。

UPDATE: I am able to access the notebook now by using the URL printed to the console. (just copy and paste it into the Firefox browser)

I would still like to figure out how to get it to open with just the 'jupyter notebook" command the way it used to work before the update, but for now this is a useful workaround.

月亮是我掰弯的 2025-01-30 10:22:46

我首先用:
jupyter笔记本 - 生成型
然后,我没有服从并更改行C.NoteBookApp.use_redirect_file,如您所说

,现在可以使用!

I first created the file with :
jupyter notebook --generate-config
then I uncommented and change the line c.NotebookApp.use_redirect_file as you said

and now it works !

鸠魁 2025-01-30 10:22:46

我使用Ubuntu上的Snap的Firefox面临同一问题。22.04。
我注意到设置 c.notebookApp.use_redirect_file = false 在生成 jupyter_notebook_config.py.py 在启动 jupyter笔记本时起作用,但失败了 jupyter -lab (粘贴错误)。我发现做类似的操作以解决 jupyter-lab

jupyter server --generate-config

然后编辑生成的 ./ jupyter/jupyter/jupyter_server_server_config.py.py 和set c.serverapp.use_redirect_file_file_file_file = false 。现在运行 jupter-lab 也可以在snap firefox中工作。也许您可以这样尝试,并且只需通过 Jupyter-lab 运行,如果它也适合您。

顺便提一句。如果您只使用Chrome,则无需这些问题,以某种方式仅出现Ubuntu上的Snap 22.04的Firefox出现问题。
否则,您可以查看 jupyter笔记本 - debug 和/或重新安装jupyterlab。

I faced the same issue using Firefox from snap on Ubuntu 22.04.
I noticed that setting c.NotebookApp.use_redirect_file = False in generated jupyter_notebook_config.py works when launching jupyter notebook, but fails for jupyter-lab (error you pasted). I found that doing something similar to fix the problem for jupyter-lab:

jupyter server --generate-config

Then edit the generated ./jupyter/jupyter_server_config.py and set c.ServerApp.use_redirect_file = False. Now running jupter-lab works in snap firefox too. Maybe you can try this way and just run via jupyter-lab if it works for you too.

Btw. none of this is needed if you just use Chrome, somehow the problem only occurs for firefox from snap on Ubuntu 22.04.
Otherwise you could check out jupyter notebook --debug and/or reinstalling JupyterLab.

庆幸我还是我 2025-01-30 10:22:46

我使用Epiphany Web浏览器,而不是Firefox作为默认的Web浏览器,每个浏览器都可以正常工作

I use epiphany web browser instead of Firefox as a default web browser and everythings work fine

国产ˉ祖宗 2025-01-30 10:22:46

我发现的问题是,发射器没有使用可行的jupyter笔记本的路径。从终端i获得:

$ whereis jupyter-notebook
jupyter-notebook: /home/brombo/miniconda3/bin/jupyter-notebook /home/brombo/.local/bin/jupyter-notebook

命令/home/brombo/miniconda3/bin/jupyter-notebook 将启动笔记本,但 /home/brombo/.local/bin/bin/bin/jupyter-notebook 不会。如果您在 .local/share/applications/jupyter -notebook.desktop 的Exec行中使用第一个。

[Desktop Entry]
Name=Jupyter Notebook
Comment=Run Jupyter Notebook
Exec=/home/brombo/miniconda3/bin/jupyter-notebook %f
Terminal=true
Type=Application
Icon=notebook
StartupNotify=true
MimeType=application/x-ipynb+json;
Categories=Development;Education;
Keywords=python;

The problem I found is that the launcher is not using a path to Jupyter Notebook that works. From terminal I get:

$ whereis jupyter-notebook
jupyter-notebook: /home/brombo/miniconda3/bin/jupyter-notebook /home/brombo/.local/bin/jupyter-notebook

The command /home/brombo/miniconda3/bin/jupyter-notebook will start notebook but /home/brombo/.local/bin/jupyter-notebook will not. If you use the first in the exec line of .local/share/applications/jupyter-notebook.desktop everything works -

[Desktop Entry]
Name=Jupyter Notebook
Comment=Run Jupyter Notebook
Exec=/home/brombo/miniconda3/bin/jupyter-notebook %f
Terminal=true
Type=Application
Icon=notebook
StartupNotify=true
MimeType=application/x-ipynb+json;
Categories=Development;Education;
Keywords=python;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文