警告:autodoc:导入类失败。没有名为“ nats”的模块

我在sphinx中建立文件时遇到问题。我有一个asyncio-nats-client库,但无法理解它如何依赖于构建狮身人面像markdown文档。

我已经为我的asyncio python项目安装了sphinx和recommonmark库。当我输入make markdown时,出现错误消息:

WARNING: autodoc: failed to import class 'api_access_rules.API' from module 'lib'; the following exception was raised:
No module named 'nats'

我在Pycharm工作,我的项目结构是:

- project_name
  - docs
  - lib

在lib中,我有要制作markdown文档的类。 在docs sphinx文件

这是我的conf.py:

import os
import sys

sys.path.insert(0,os.path.join(os.path.dirname(__file__),'../../'))


extensions = [
    'recommonmark','sphinx.ext.autodoc','sphinx.ext.todo','sphinx.ext.coverage','sphinx.ext.extlinks',]

source_suffix = {
    '.rst': 'restructuredtext','.txt': 'markdown','.md': 'markdown',}

templates_path = ['_templates']
exclude_patterns = []


html_theme = 'bizstyle'

html_static_path = ['_static']

还有我的index.rst:

Welcome to managing-nats-api's documentation!
=============================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

.. autoclass:: lib.api_access_rules.API
   :members:

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

请帮忙,我将近一周时间尝试解决此问题。尝试make clean无结果。

guandehuo520 回答:警告:autodoc:导入类失败。没有名为“ nats”的模块

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3119789.html

大家都在问