简体   繁体   English

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

[英]Error when opening Jupyter Notebook from terminal on Mac

I get the following error when trying to open a Jupyter Notebook (using the command jupyter notebook) from the terminal on mac.尝试从 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'

I have tried to uninstall and re-install.我已尝试卸载并重新安装。 I still face the same error.我仍然面临同样的错误。 I have tried to clear the bash profile, to no avail.我试图清除 bash 配置文件,但无济于事。

Any help would be highly welcome and appreciated.任何帮助都将受到高度欢迎和赞赏。

Best, Mridula最好的,Mridula

I'm summarizing our conversations here as it helped you to resolve the problem.我在这里总结了我们的对话,因为它可以帮助您解决问题。

There could be many possible options to address this issue.可以有许多可能的选择来解决这个问题。 However, the very first approach to tackle this problem is to resolve permission issues.但是,解决此问题的第一种方法是解决权限问题。 The last line of your error message is PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated' which means you don't have the right permission to access the .jupyter directory.错误消息的最后一行是PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated'这意味着您没有访问.jupyter目录的正确权限。

Change file permission更改文件权限

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

If this doesn't help then do the following steps如果这没有帮助,请执行以下步骤

  • uninstall Anaconda卸载 Anaconda
  • remove .jupyter directory from your user从您的用户中删除 .jupyter 目录
  • install a fresh copy of Anaconda安装 Anaconda 的新副本

Hope it helps!希望能帮助到你!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM