ubuntu中运行jupyter notebook创建Python文件的时候报错

创建Python文件的时候遇到下面的错误:

Creating Notebook Failed
An error occurred while creating a new notebook.
Unexpected error while saving file: arma/Untitled.ipynb [Errno 13] Permission denied: ‘/home/wang/.local/share/jupyter/notebook_secret’

解决方案:
修改文件权限:
(my_env) wang@ubuntu:~ sudochmod+777.local/share/jupyter/(myenv)wang@ubuntu:  cd .local/share/jupyter/
(my_env) wang@ubuntu:~/.local/share/jupyter lsruntime(myenv)wang@ubuntu: /.local/share/jupyter sudo chmod +777 runtime/
(my_env) wang@ubuntu:~/.local/share/jupyter cdruntime/(myenv)wang@ubuntu: /.local/share/jupyter/runtime ls
notebook_cookie_secret
(my_env) wang@ubuntu:~/.local/share/jupyter/runtime sudovinotebookcookiesecret(myenv)wang@ubuntu: /.local/share/jupyter/runtime ls
notebook_cookie_secret
(my_env) wang@ubuntu:~/.local/share/jupyter/runtime cd/home/wpython/(myenv)wang@ubuntu:/home/wpython ls
arma blog learn learn2 learning_log PycharmProjects

重新启动jupyter notebook 即可;

(my_env) wang@ubuntu:~/.local/share/jupyter/runtime lsnotebookcookiesecret(myenv)wang@ubuntu: /.local/share/jupyter/runtime cd /home/wpython/
(my_env) wang@ubuntu:/home/wpython lsarmabloglearnlearn2learninglogPycharmProjects(myenv)wang@ubuntu:/home/wpython jupyter notebook
[I 15:57:54.731 NotebookApp] Serving notebooks from local directory: /home/wpython
[I 15:57:54.732 NotebookApp] 0 active kernels
[I 15:57:54.732 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=487d99c93782f3dab2319c50d2a156ea32f4fabd424bf84e
[I 15:57:54.732 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 15:57:54.737 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8888/?token=487d99c93782f3dab2319c50d2a156ea32f4fabd424bf84e

已在现有的浏览器会话中创建新的窗口。
[I 15:58:17.945 NotebookApp] 302 GET /?token=487d99c93782f3dab2319c50d2a156ea32f4fabd424bf84e (127.0.0.1) 1.40ms
[I 15:58:38.839 NotebookApp] Creating new notebook in /arma
[I 15:58:38.845 NotebookApp] Writing notebook-signing key to /home/wang/.local/share/jupyter/notebook_secret
[I 15:58:40.769 NotebookApp] Kernel started: 4ff8f979-8a16-4cce-b05c-c2a51c448dc6
[I 16:00:40.584 NotebookApp] Saving file at /arma/Untitled.ipynb

你可能感兴趣的:(Ubuntu16.04)