Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sphinx Sphinx无法导入模块依赖项_Python Sphinx_Python 3.7_Setup.py_Read The Docs_Cookiecutter - Fatal编程技术网

Python sphinx Sphinx无法导入模块依赖项

Python sphinx Sphinx无法导入模块依赖项,python-sphinx,python-3.7,setup.py,read-the-docs,cookiecutter,Python Sphinx,Python 3.7,Setup.py,Read The Docs,Cookiecutter,编写的python工具具有以下由构建的目录结构 其中setup.py包含以下内容: Click>=6.0 boto3>=1.5.0 awscli>=1.13.0 humanize>=0.5.1 docutils>=0.15.2 要求=['点击>=6.0','boto3>=1.5.0','awscli>=1.13.0','人性化>=0.5.1'] 其中conf.py包含以下内容: Click>=6.0 boto3>=1.5.0 awscli>=1

编写的python工具具有以下由构建的目录结构

其中setup.py包含以下内容:

Click>=6.0
boto3>=1.5.0
awscli>=1.13.0
humanize>=0.5.1
docutils>=0.15.2
要求=['点击>=6.0','boto3>=1.5.0','awscli>=1.13.0','人性化>=0.5.1']
其中conf.py包含以下内容:

Click>=6.0
boto3>=1.5.0
awscli>=1.13.0
humanize>=0.5.1
docutils>=0.15.2
导入操作系统
导入系统
sys.path.insert(0,os.path.abspath('..'))
进口awscli_堡垒
和.readthedocs.yml包含:

# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
  configuration: docs/conf.py

# Build documentation with MkDocs
#mkdocs:
#  configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

# Optionally set the version of Python and requirements required to build your docs
python:
  version: 3.7
当sphinx在本地构建时,所有模块功能都会自动记录

当我在readthedoc.io上构建时,它可以成功导入所有awscli_bastion包模块,但由于导入失败,它无法自动记录模块功能

WARNING: autodoc: failed to import module 'cache' from module 'awscli_bastion'; the following exception was raised:
No module named 'dateutil'
WARNING: autodoc: failed to import module 'cli' from module 'awscli_bastion'; the following exception was raised:
No module named 'botocore'
WARNING: autodoc: failed to import module 'credentials' from module 'awscli_bastion'; the following exception was raised:
No module named 'botocore'
WARNING: autodoc: failed to import module 'minimal' from module 'awscli_bastion'; the following exception was raised:
No module named 'boto3'
WARNING: autodoc: failed to import module 'sts' from module 'awscli_bastion'; the following exception was raised:
No module named 'botocore'

这就是渲染的对象


为什么readthedoc.io virtualenv没有安装setup.py中定义的依赖项?

好的,我想通过创建一个包含以下内容的文件来获得要安装的依赖项:

Click>=6.0
boto3>=1.5.0
awscli>=1.13.0
humanize>=0.5.1
docutils>=0.15.2
然后在.readthedocs.yml中引用它

python:
  version: 3.7
  install:
    - requirements: docs/requirements.txt

对于需求,最好参考setup.py,这样我就不必对它们进行两次定义。

您可以这样做。假设您添加了一个。