我使用wx-python v4.0.0b2(Phoenix)创建了一个项目,我正在尝试使用Sphinx来记录它。
我有一个目录结构如下:
app/
|----models/
| |----__init__.py
| |----foo.py
|----views/
| |----__init__.py
| |----package1/
|----__init__.py
docs/
|----conf.py (normally this one is not considered at build)
|----rst/ (sphinx build src directory)
| |----conf.py (this one has the mocks and imports)
[SHPINX project structure]
requirements.txt
[other stuff]
事实是,当我运行sphinx-build
时,它会给我以下错误:
Traceback (most recent call last):
File "/home/alastard/dev/LowVoltageTool-final/docs/.venv/lib/python3.5/site-packages/sphinx/ext/autodoc.py", line 658, in import_object
__import__(self.modname)
File "/home/alastard/dev/LowVoltageTool-final/app/__init__.py", line 10, in <module>
from . import models, serialization, wxviews
File "/home/alastard/dev/LowVoltageTool-final/app/wxviews/__init__.py", line 7, in <module>
from . import core, drawers, items, panels, patterns
File "/home/alastard/dev/LowVoltageTool-final/app/wxviews/core/__init__.py", line 4, in <module>
import wx
ImportError: No module named 'wx'
所以我猜错误来自我的conf.py中的一个问题,其中包含以下内容:
extensions = ['sphinx.ext.autodoc']
autodoc_mock_imports = ['anytree', 'numpy', 'scipy', 'wxPython']
所以我真的想知道如何模仿wxPython?如果没有,我怎么能在不这样做的情况下让狮身人面像工作呢?