以.rst格式从Sphinx中的文件导入多个表

问题描述 投票:1回答:1

我想在一个.csv中从多个源.rst文件导入多个表。类似下面的.rst样本:

=======
Section
=======

subsection01
------------
.. csv-table:: my_table1
   :file: my_file1.csv

subsection02
------------
.. csv-table:: my_table2
   :file: my_file2.csv

但是,这给了我一个错误:

Exception occurred:
  File "/var/jenkins_home/.local/lib/python2.7/site-packages/sphinx/environment/__init__.py", line 612, in get_doctree
    doctree = pickle.load(f)
ValueError: unsupported pickle protocol: 4
The full traceback has been saved in /tmp/sphinx-err-IQAuoY.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:20: recipe for target 'html' failed
make: *** [html] Error 2
Build step 'Execute shell' marked build as failure
Finished: FAILURE

我必须提一下,如果我将每个import块放在一个单独的.rst上面,它们就可以正常工作了。但这不是我需要的。上面的消息对我来说似乎是一个sphinx bug /问题。

有什么想法/解决方案吗?

python python-sphinx restructuredtext
1个回答
1
投票

可能需要更新版本的Python来阅读pickle输出:) Pickles协议版本4看起来像是在Python 3.4中添加的,更新可能有用!

Exception occurred:
  File "/var/jenkins_home/.local/lib/python2.7/site-packages/sphinx/environment/__init__.py", line 612, in get_doctree
    doctree = pickle.load(f)
ValueError: unsupported pickle protocol: 4
© www.soinside.com 2019 - 2024. All rights reserved.