【问题标题】:Read the Docs with nbsphinx使用 nbsphinx 阅读文档
【发布时间】:2021-01-11 20:17:06
【问题描述】:

我为Read the Docs 创建了自己的docs。查看我的存储库 我的一些文档文件是 jupyter notebook,所以我使用了nbshpinx

在我的计算机中,我安装了所有依赖项,当我使用 make html 时效果很好。 但是,阅读文档会引发错误:

Running Sphinx v1.8.5
loading translations [en]... done

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 472, in load_extension
    mod = __import__(extname, None, None, ['setup'])
ModuleNotFoundError: No module named 'nbsphinx'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 303, in build_main
    args.tags, args.verbosity, args.jobs, args.keep_going)
  File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 228, in __init__
    self.setup_extension(extension)
  File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 449, in setup_extension
    self.registry.load_extension(self, extname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/complex-valued-neural-networks/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 475, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname, err)
sphinx.errors.ExtensionError: Could not import extension nbsphinx (exception: No module named 'nbsphinx')

Extension error:
Could not import extension nbsphinx (exception: No module named 'nbsphinx')

this tutorial之后我创建了两个yml文件,错误改为:

Error
Problem in your project's configuration. Invalid "conda.environment": environment not found

【问题讨论】:

    标签: restructuredtext read-the-docs nbsphinx


    【解决方案1】:

    解决了! 我关注了this tutorial

    我在readthedocs.yml加了:

    python:
      version: 3
      install:
        - requirements: docs/requirements.txt
      system_packages: true
    

    然后在docs/requirements.txt:

    ipykernel
    nbsphinx
    

    如果有问题,您可以随时查看repository 我在哪里做的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-04
      • 1970-01-01
      • 1970-01-01
      • 2013-09-05
      • 2018-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多