如何正确安装 nbgrader 扩展?

如何正确安装 nbgrader 扩展?

我在尝试为 jupyterhub 安装 nbgrader 扩展时遇到此错误。这个错误可能是一个微不足道的错误,但我无法修复它。

nbgrader extension install

Unrecognized JSON config file version, assuming version 1
Installing create_assignment extension
Making directory: /usr/local/share/jupyter/nbextensions/create_assignment/
Traceback (most recent call last):
  File "/home/mark/.local/bin/nbgrader", line 11, in <module>
    sys.exit(main())
  File "/home/mark/.local/lib/python3.5/site-packages/nbgrader/apps/nbgraderapp.py", line 249, in main
    NbGraderApp.launch_instance()
  File "/home/mark/.local/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/mark/.local/lib/python3.5/site-packages/traitlets/config/application.py", line 596, in launch_instance
    app.start()
  File "/home/mark/.local/lib/python3.5/site-packages/nbgrader/apps/nbgraderapp.py", line 242, in start
    super(NbGraderApp, self).start()
  File "/home/mark/.local/lib/python3.5/site-packages/jupyter_core/application.py", line 256, in start
    self.subapp.start()
  File "/home/mark/.local/lib/python3.5/site-packages/nbgrader/apps/extensionapp.py", line 249, in start
    super(ExtensionApp, self).start()
  File "/home/mark/.local/lib/python3.5/site-packages/jupyter_core/application.py", line 256, in start
    self.subapp.start()
  File "/home/mark/.local/lib/python3.5/site-packages/nbgrader/apps/extensionapp.py", line 56, in start
    self.install_extensions()
  File "/home/mark/.local/lib/python3.5/site-packages/nbgrader/apps/extensionapp.py", line 46, in install_extensions
    logger=self.log)
  File "/home/mark/.local/lib/python3.5/site-packages/notebook/nbextensions.py", line 206, in install_nbextension
    os.makedirs(dest_dir)
  File "/usr/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/share/jupyter/nbextensions/create_assignment/'

感谢您提出解决此问题的建议。

答案1

对于这种特殊情况,我只需将 --user 添加到我的命令中,如下所示:

nbgrader extension install --user

我不知道如何解决,但它解决了问题。

答案2

如果你nbgraderconda这个安装应该不是问题:

 $ conda install nbgrader -c conda-forge

相关内容