AttributeError: 'PDFWriter' object has no attribute 'custom_cover' #860

41 views
Skip to first unread message

Beat Gurtner

unread,
May 8, 2020, 2:29:19 AM5/8/20
to sphinx-users

Cant' create PDF's anymore, earlier I could but then I guess I messed up my python installation on my mac...

I run this command:


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.


Description of problem
Don't know the steps to reproduce the problem... (sorry)

I tried reinstalling rst2pdf. This worked without any errors.

I tried reinstalling pdfbuilder:
Could only uninstall it. When I wanted to reinstall it I got this error:

pip install pdfbuilder
ERROR: Could not find a version that satisfies the requirement pdfbuilder (from versions: none)
ERROR: No matching distribution found for pdfbuilder


🖥 Versions

python -V
Python 2.7.10


pip freeze | grep rst2pdf
rst2pdf==0.96


pip freeze | grep reportlab
reportlab==3.5.42


pip freeze | grep Sphinx

Sphinx==1.8.5


Which operating system are you using?
MacOS Mojave 10.14.1 (18B75)

Stefano David

unread,
May 10, 2020, 1:12:41 PM5/10/20
to sphinx-users
Hi Beat,

I think you should update your python environment. A couple of thoughts:

1. python2.7 is EOL since last January
2. sphinx 1.8.5 is quite old either (not sure if it's EOL yet, though).
3. pdfbuilder needs python>3.5 according to pypi [1], this is why you can't install it with pip/python 2.7
4. your message appears as light gray on white, quite difficult to read :-)

Best regards,
Stefano

Beat Gurtner

unread,
May 11, 2020, 10:01:53 AM5/11/20
to sphinx-users
Hi Stefano,

sorry for the gray font.

Tried to install python3, but:

Warning: python 3.7.7 is already installed and up-to-date


So pdfbuilder should work?!?

I know its all old stuff, but it was still working :)

Terris Linenbach

unread,
May 11, 2020, 10:29:52 AM5/11/20
to sphinx...@googlegroups.com

It fails trying to log the error that it can’t find a custom cover - whatever that is. It can’t find the custom cover because some object doesn’t have a custom_cover attribute. Perhaps create an issue at https://github.com/rst2pdf/rst2pdf.


I’m curious how rst2pdf is involved. My Sphinx setup still uses latex2pdf. Going directly from restructured text to pdf seems better but since Sphinx has more features than rst, there are probably issues.


[ERROR] pdfbuilder.py:149 


/rst2pdf/pdfbuilder.py", line 595, in translate log.error("Can't find cover template %s, using 


AttributeError: 'PDFWriter' object has no attribute 'custom_cover' 


--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/450b40d9-806b-4de6-8814-b83a36cf09da%40googlegroups.com [groups.google.com].
--
    


Terris Linenbach 

Senior Software Engineer 


Beat Gurtner

unread,
May 12, 2020, 4:55:50 AM5/12/20
to sphinx-users
I think I solved the problem with those steps:

    brew upgrade sphinx-doc
    pip3 install -U sphinx
    pip3 install sphinx-rtd-theme
    pip3 install --user rst2pdf

But now I really am confused, wether now I use python3 or 2 :D

Anyway, my script seems to be running again
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages