从Mac上的终端打开Jupyter Notebook时出错

时间:2018-09-15 22:48:30

标签: python jupyter-notebook

当尝试从Mac上的终端打开Jupyter Notebook(使用Jupyter Notebook命令)时,出现以下错误。

Traceback (most recent call last):
  File "/Applications/anaconda3/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1531, in initialize
    super(NotebookApp, self).initialize(argv)
  File "<decorator-gen-6>", line 2, in initialize
  File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 242, in initialize
    self.migrate_config()
  File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 168, in migrate_config
    migrate()
  File "/anaconda3/lib/python3.6/site-packages/jupyter_core/migrate.py", line 247, in migrate
    with open(os.path.join(env['jupyter_config'], 'migrated'), 'w') as f:
PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated'

我尝试卸载并重新安装。我仍然面临同样的错误。我试图清除bash配置文件,但无济于事。

我们将竭诚欢迎您的帮助。

最好, rid子

1 个答案:

答案 0 :(得分:2)

我在这里总结我们的对话,因为它可以帮助您解决问题。

可能有许多可能的选项来解决此问题。但是,解决此问题的第一种方法是解决权限问题。错误消息的最后一行是PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated',这意味着您没有访问.jupyter目录的正确权限。

更改文件权限

sudo chmod -R 755 /Users/Mridula/.jupyter/

如果这没有帮助,请执行以下步骤

  • 卸载Anaconda
  • 从用户中删除.jupyter目录
  • 安装新版本的Anaconda

希望有帮助!