ImportError: No module named 'Cython' when installing requirements on readthedocs server

ImportError: No module named 'Cython' when installing requirements on readthedocs server

我想使用扩展程序自动生成 readthedocs 代码片段中示例的输出。我找到了一个执行此操作的模块,sphinx-autorun。但是,当我尝试安装我的包所需的所有模块时(在 readthedocs 的要求中),我在 readthedocs 的构建日志中收到错误,即:

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-tsfmsady/clustertree/setup.py", line 6, in <module>
    from Cython.Build import cythonize
ImportError: No module named 'Cython' 

关于如何解决这个问题的任何提示?我设置了以下选项:

基于 conda 的构建对我有用。

您可以将 readthedocs.yml 放在您的存储库的根文件夹中(而不是您的文档文件夹):

requirements_file:
  docs/requirements.txt

conda:
    file: environment.yml

我的conda environment.yml:

channels:
- conda-forge
- bioconda
- r
- jkroes
dependencies:
- cython
- python=3.6
- numpy
- pandas
- sphinx-autorun=1.1.0=py36h5809654_0

你甚至可以在 conda yaml 中有一个 pip 部分:

channels:
- conda-forge
- bioconda
- r
- jkroes
dependencies:
- cython
- python=3.6
- numpy
- pandas
- pip:
    - clustertree
    - pyranges
    - sphinx_autorun_ebs
    - pyrle
    - sorted_nearest