我正在嘗試在 Ubuntu 21.10 上運行 Jupyter 筆記本。我已經安裝了 python、jupyter notebook 和所有各種先決條件。我添加export PATH=$PATH:~/.local/bin到我bashrc的,以便命令jupyter notebook可以從終端運行。
當我jupyter notebook從終端呼叫時,我從瀏覽器收到以下錯誤訊息:
Access to the file was denied.
The file at /home/username/.local/share/jupyter/runtime/nbserver-260094-open.html is not readable.
It may have been removed, moved, or file permissions may be preventing access.
我正在使用最新版本的 FireFox。
我已經閱讀了許多關于這方面的指南,這似乎是一個權限錯誤,但我使用的指南都沒有解決這個問題。使用sudo沒有幫助,實際上它會導致Exception: Jupyter command "jupyter-notebook" not found.被拋出。
話雖如此,我仍然能夠訪問筆記本服務器。如果我轉到終端,而是單擊localhost:8888筆記本服務器的 IP 地址或 IP 地址,它會將我帶到筆記本,并且一切運行都沒有問題。
我想解決這個問題,這樣當我運行時,我會jupyter notebook被帶到服務器,而無需回傳終端視窗并單擊 IP 地址。如果我同時運行多個筆記本,這很不方便并且會減慢我的速度。
對此問題的任何幫助將不勝感激!
uj5u.com熱心網友回復:
我有同樣的問題。
Ubuntu 20.04.3 LTS Chromium 版本 96.0.4664.110
這是我的解決方案:
Create the configuration file: jupyter-notebook --generate-config
Edit the configuration file /home//.jupyter/jupyter_notebook_config.py and set:
c.NotebookApp.use_redirect_file = False
確保此配置引數從行首開始。如果在行首留一個空格,您將收到拒絕訪問檔案的訊息。
否則你可以清理重新安裝 JupyterLab
jupyter lab clean --all
pip3 install jupyterlab --force-reinstall
uj5u.com熱心網友回復:
試試這個
sudo nano ~/.bashrc
在檔案開頭添加:
export XDG_RUNTIME_DIR=""
按 Ctrl-o 寫入檔案,按 Ctrl x 退出。
現在輸入:
source ~/.bashrc
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/414834.html
標籤:
