我想使用狮身人面像证明我的MATLAB类。但每当我想运行make html
我得到以下错误:狮身人面像matlab文档错误:缺少模块'标准'
% make html
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v1.4.6
Extension error:
Could not import extension sphinxcontrib.matlab (exception: No module named 'std')
make: *** [Makefile:53: html] Error 1
我在的ArchLinux并尝试以下安装方式,但都产生相同的问题:
尝试1:
yaourt -S python-sphinx # (was already installed by default, just to show that the package came from arch repo)
sudo pip install -U sphinxcontrib-matlabdomain
尝试2:
yaourt -R python-sphinx # (I also removed all dependencies)
sudo pip -U install sphinx
sudo pip -U install -U sphinxcontrib-matlabdomain
在既不是它的工作的情况下(总上面的错误)。在每一个尝试我也验证了std
模块那里通过
# ll /usr/lib/python3.5/site-packages/sphinxcontrib*
-rw-r--r-- 1 root root 326 Sep 28 11:02 /usr/lib/python3.5/site-packages/sphinxcontrib_blockdiag-1.5.5-py2.7-nspkg.pth
-rw-r--r-- 1 root root 326 Sep 28 11:00 /usr/lib/python3.5/site-packages/sphinxcontrib_matlabdomain-0.2.7-py3.5-nspkg.pth
/usr/lib/python3.5/site-packages/sphinxcontrib:
total 152
-rw-r--r-- 1 root root 11457 Sep 28 11:02 blockdiag.py
-rw-r--r-- 1 root root 37815 Jun 20 2015 mat_documenters.py
-rw-r--r-- 1 root root 27529 Oct 7 2014 matlab.py
-rw-r--r-- 1 root root 46088 Jun 20 2015 mat_types.py
drwxr-xr-x 1 root root 126 Sep 28 11:03 __pycache__
-rw-r--r-- 1 root root 22278 Feb 7 2014 std.py
/usr/lib/python3.5/site-packages/sphinxcontrib_blockdiag-1.5.5.dist-info:
total 32
-rw-r--r-- 1 root root 1033 Sep 28 11:02 DESCRIPTION.rst
-rw-r--r-- 1 root root 4 Sep 28 11:03 INSTALLER
-rw-r--r-- 1 root root 2127 Sep 28 11:02 METADATA
-rw-r--r-- 1 root root 1193 Sep 28 11:02 metadata.json
-rw-r--r-- 1 root root 14 Sep 28 11:02 namespace_packages.txt
-rw-r--r-- 1 root root 1054 Sep 28 11:03 RECORD
-rw-r--r-- 1 root root 14 Sep 28 11:02 top_level.txt
-rw-r--r-- 1 root root 110 Sep 28 11:02 WHEEL
/usr/lib/python3.5/site-packages/sphinxcontrib_matlabdomain-0.2.7-py3.5.egg-info:
total 40
-rw-r--r-- 1 root root 1 Sep 28 11:00 dependency_links.txt
-rw-r--r-- 1 root root 487 Sep 28 11:00 installed-files.txt
-rw-r--r-- 1 root root 14 Sep 28 11:00 namespace_packages.txt
-rw-r--r-- 1 root root 1 Jun 20 2015 not-zip-safe
-rw-r--r-- 1 root root 8547 Sep 28 11:00 PKG-INFO
-rw-r--r-- 1 root root 28 Sep 28 11:00 requires.txt
-rw-r--r-- 1 root root 549 Sep 28 11:00 SOURCES.txt
-rw-r--r-- 1 root root 14 Sep 28 11:00 top_level.txt
PS:我的默认Python有版本3.5.2
编辑1:
% head $(which sphinx-build)
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from sphinx import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
% which sphinx-build
/usr/bin/sphinx-build
% sphinx-build --version
Sphinx (sphinx-build) 1.4.6
% python --version
Python 3.5.2
% /usr/bin/python --version
Python 3.5.2
你的'sphinx-build'运行在Python 3.5上吗? 'head $(狮身人面像 - 构建)'给你什么?另外,'sphinx-build'给了什么? –
@MartinUeding谢谢你的评论。我用一些信息更新了这篇文章。我猜它是用Python 3.5运行的。有没有一种方法可以确定吗? – bonanza
您可以将Python版本的'print()'语句添加到'conf.py'。但我的预感是你的插件是为Python 2而设计的(就像同一个仓库中的'feed'插件),并且Python 3的新导入规则导致导入失败。所以试着用'python2'安装Sphinx,也许你在Arch Linux上有'pip2'。那么你的扩展可能工作。 –