码迷,mamicode.com
首页 > 其他好文 > 详细

ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions' .ipynb文件转换.py文件时遇到错误

时间:2020-06-02 09:26:30      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:core   sso   processor   most   文件   --   pytho   src   install   

C:\Users\moyuan\Desktop\fire500>jupyter nbconvert --to script *.ipynb
Traceback (most recent call last):
  File "E:\Work_Software\Anaconda3\Scripts\jupyter-nbconvert-script.py", line 10, in <module>
    sys.exit(main())
  File "E:\Work_Software\Anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "E:\Work_Software\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
    app.start()
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 337, in start
    self.convert_notebooks()
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 497, in convert_notebooks
    self.exporter = cls(config=self.config)
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\exporters\templateexporter.py", line 256, in __init__
    super(TemplateExporter, self).__init__(config=config, **kw)
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 109, in __init__
    self._init_preprocessors()
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 263, in _init_preprocessors
    self.register_preprocessor(preprocessor, enabled=True)
  File "E:\Work_Software\Anaconda3\lib\site-packages\nbconvert\exporters\exporter.py", line 224, in register_preprocessor
    preprocessor_cls = import_item(preprocessor)
  File "E:\Work_Software\Anaconda3\lib\site-packages\traitlets\utils\importstring.py", line 34, in import_item
    module = __import__(package, fromlist=[obj])
ModuleNotFoundError: No module named ‘jupyter_contrib_nbextensions‘

 将.ipynb文件转换.py文件时遇到错误

 转换命令

1 jupyter nbconvert --to script *.ipynb 

错误原因,没有jupyter_contrib_nbextensions,可尝试下面的解决方案

1 python -m pip install --user jupyter_contrib_nbextensions
2 jupyter contrib nbextension install --user --skip-running-check
3 python -m pip install --user jupyter_nbextensions_configurator
4 jupyter nbextensions_configurator enable --user

再次运行指令

1 jupyter nbconvert --to script *.ipynb 

 

技术图片

 

 成功

 参考博客:https://blog.csdn.net/m0_37586991/article/details/103180717

 

ModuleNotFoundError: No module named 'jupyter_contrib_nbextensions' .ipynb文件转换.py文件时遇到错误

标签:core   sso   processor   most   文件   --   pytho   src   install   

原文地址:https://www.cnblogs.com/study-/p/13029182.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!