天天看點

Ubuntu的jupyter出現:PermissionError: [Errno 13] Permission denied: '/home/.local/share/jupyter/runtime'

Ubuntu運作jupyter時出現PermissionError: [Errno 13] Permission denied: '/home/hadoop/.local/share/jupyter/runtime’的錯誤。

解決辦法

執行如下代碼修改Jupyter的一部分檔案的權限:

sudo chmod 777 ~/.local/share/jupyter/
cd ~/.local/share/jupyter/
ls
sudo chmod 777 runtime/
           

注:如果你的jupyter檔案裡面沒有runtime檔案夾,可以不必運作sudo chmod 777 runtime/

接下來,就可以愉快地運作jupyter notebook了:

jupyter notebook --ip=0.0.0.0 --no-browser --allow-root
           

番外:如果出現PermissionError: [Errno 13] Permission denied: '/run/user/0/jupyter’的錯誤可以使用下面的代碼

chmod -777 /run/user
           

需要給/run/user整個目錄開放權限,因為jupyter是需要往目錄中添加檔案,/run/user/0/jupyter,此時可能還沒有建立出來