首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >rst2pdf AttributeError:“PDFWriter”对象没有属性“”custom_cover“”

rst2pdf AttributeError:“PDFWriter”对象没有属性“”custom_cover“”
EN

Stack Overflow用户
提问于 2020-05-10 01:23:09
回答 1查看 488关注 0票数 0

不能再创建PDF了,之前我可以,但我猜我搞砸了我在mac上的python安装…

我运行以下命令:

代码语言:javascript
复制
sphinx-build -D language=de -b pdf /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer_medical_doc/pdf/de/

/usr/local/bin/sphinx-build:11: RemovedInSphinx20Warning: sphinx.main()has moved tosphinx.cmd.build.main(). sys.exit(main()) 

Sphinx v1.8.5 in Verwendung Lade Übersetzungen 
[de]…erledigt Lade pickle Umgebung...erledigt 
building [mo]: targets for 0 po files that are out of date building [pdf]: targets for 23 source files that are out of date updating environment: 
0 added, 0 changed, 0 removed looking for now-outdated files... none found processing Sakkadentrainer_Dokumentation_de_v1.0... index faq medical_product registration payment login pw_forgot general_training car train dot img1 img3 statistics statistics_details settings settings_profile settings_general settings_display settings_exercises settings_change_pwd settings_del eyetracking resolving references... done writing Sakkadentrainer_Dokumentation_de_v1.0... 

[ERROR] pdfbuilder.py:149 'PDFWriter' object has no attribute 'custom_cover' Traceback (most recent call last): File "/Users/beatgurtner/Library/Python/2.7/lib/python/site-packages/rst2pdf/pdfbuilder.py", line 146, in write docwriter.write(doctree, destination) 
File "/Library/Python/2.7/site-packages/docutils/writers/__init__.py", line 78, in write self.translate() File "/Users/beatgurtner/Library/Python/2.7/lib/python/site-packages/rst2pdf/pdfbuilder.py", line 595, in translate log.error("Can't find cover template %s, using default"%self.custom_cover) 
AttributeError: 'PDFWriter' object has no attribute 'custom_cover' FAILED build abgeschlossen.

问题描述不知道重现问题的步骤...(抱歉)

我尝试重新安装rst2pdf。这工作起来没有任何错误。

我尝试重新安装pdfbuilder:只能卸载它。当我想要重新安装它时,我得到了这个错误:

代码语言:javascript
复制
pip install pdfbuilder
ERROR: Could not find a version that satisfies the requirement pdfbuilder (from versions: none)
ERROR: No matching distribution found for pdfbuilder

版本

python -V Python 2.7.10

pip freeze | grep rst2pdf rst2pdf==0.96

pip freeze | grep报告pip reportlab==3.5.42

pip freeze | grep Sphinx Sphinx==1.8.5

您使用的是哪种操作系统?MacOS Mojave 10.14.1 (18B75)

EN

回答 1

Stack Overflow用户

发布于 2020-05-12 16:55:02

我想我已经通过这些步骤解决了问题:

代码语言:javascript
复制
brew upgrade sphinx-doc
pip3 install -U sphinx
pip3 install sphinx-rtd-theme
pip3 install --user rst2pdf

但是现在我真的很困惑,到底是用python3还是2 :D

不管怎样,我的脚本似乎又开始运行了

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61700842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档