执行make html后,我收到以下警告/错误:
警告#1
WARNING: html_static_path entry '_static' does not exist
错误#1
WARNING: autodoc: failed to import module 'filename.py' from module 'modulename'; the following exception was raised:
No module named 'statsmodels'
brew update
,然后运行brew upgrade
,即可解决这些错误(感谢@bad_coder)。好像更新解决了autodoc_mock_imports
新问题:由于以下错误,我的某些模块未导入:
File “file path”, line 36, in Individual
ml_params = {'C': random.choice(svr_C), 'gamma': random.choice(svr_gamma)}
File "/usr/local/Cellar/sphinx-doc/3.1.1/libexec/lib/python3.8/random.py", line 290, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
我已经忽略了随机模块。
Pycharm也在抱怨random.choice()....建议我创建函数“ choice”。问题是,“ choice”是“ random”库(或程序包?)的成员。像from random import choice
这样的显式导入可能会解决Pycharm错误,但对Sphinx不确定。