【问题标题】:Unable to start rst2html5slides after installation安装后无法启动 rst2html5slides
【发布时间】:2018-11-06 08:38:21
【问题描述】:

我们将 Powerpoint 和 Restructured Text 与 Python-Sphinx 一起使用。我在问自己,是否可以使用 ReST 创建幻灯片。

我发现了有趣的工具rst2html5slides on https://rst2html5slides.readthedocs.io/en/latest/index.html.

我安装了这个工具:

pip install rst2html5slides

这没有问题。

现在,我无法使用该工具。在我的控制台上输入 rst2html5slides 会得到:

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 5, in <module>
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 16, in <module>
    from rst2html5 import HTML5Translator, HTML5Writer
ImportError: No module named rst2html5

输入pip list 问题:

rst2html5                          1.9.4
rst2html5slides                    1.0

在检查了我的c:\python27\lib\site-packages\ 目录后,我发现有一个rst2html5slides_.py,但没有rst2html5slides.py。所以我试图重命名这个文件。

不,我可以开始 rst2html5slides --traceback presentation.txt simple_deck.html,但我还有另一个问题。

Traceback (most recent call last):
  File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "c:\python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\rst2html5slides.exe\__main__.py", line 9, in <module>
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 484, in main
    publish_cmdline(writer=SlideWriter(), description=description)
  File "c:\python27\lib\site-packages\docutils\core.py", line 352, in publish_cmdline
    config_section=config_section, enable_exit_status=enable_exit_status)
  File "c:\python27\lib\site-packages\docutils\core.py", line 219, in publish
    output = self.writer.write(self.document, self.destination)
  File "c:\python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
    self.translate()
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 200, in translate
    HTML5Writer.translate(self)
  File "c:\python27\lib\site-packages\rst2html5.py", line 227, in translate
    self.document.walkabout(visitor)
  File "c:\python27\lib\site-packages\docutils\nodes.py", line 187, in walkabout
    visitor.dispatch_departure(self)
  File "c:\python27\lib\site-packages\docutils\nodes.py", line 1895, in dispatch_departure
    return method(node)
  File "c:\python27\lib\site-packages\rst2html5slides.py", line 294, in depart_document
    self._ordered_tag_attributes(deck,
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
AttributeError: SlideTranslator instance has no attribute '_ordered_tag_attributes'
Exiting due to error.  Use "--traceback" to diagnose.
Please report errors to <docutils-users@lists.sf.net>.
Include "--traceback" output, Docutils version (0.12 [release]),
Python version (2.7.10), your OS type & version, and the
command line used.

我在这里做错了什么?

【问题讨论】:

  • 只需将包更新到最新版本

标签: html restructuredtext docutils impress.js rst2html.py


【解决方案1】:

rst2html5slides 的作者在这里。不久前我已经更新了软件包。请更新它,它应该可以运行。

【讨论】:

  • 你好。非常感谢您的回复。我将尝试使用 pip 更新 rst2html5slides。希望它能解决问题。顺便说一句,我真的很喜欢使用简单的 ReST 文件来创建漂亮的演示文稿的想法。
猜你喜欢
  • 1970-01-01
  • 2017-06-16
  • 2018-06-29
  • 2020-12-04
  • 2019-03-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多