mkdocs-pdf-export-plugin icon indicating copy to clipboard operation
mkdocs-pdf-export-plugin copied to clipboard

Building pdf outputs errors

Open lzpons opened this issue 4 years ago • 2 comments

Hi, I am trying to install your plugin for pdf generation and finding some issues. Have done it on a Mac and in a debian machine and both show the same error

mkdocs build
/Applications/anaconda3/lib/python3.6/site-packages/weasyprint/fonts.py:230: UserWarning: FontConfig: No fonts configured. Expect ugly output.
  'FontConfig: No fonts configured. '
/Applications/anaconda3/lib/python3.6/site-packages/weasyprint/document.py:36: UserWarning: There are known rendering problems and missing features with cairo < 1.15.4. WeasyPrint may work with older versions, but please read the note about the needed cairo version on the "Install" page of the documentation before reporting bugs. http://weasyprint.readthedocs.io/en/latest/install.html
  'There are known rendering problems and missing features with '
Traceback (most recent call last):
  File "/Applications/anaconda3/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
....

AttributeError: module 'mkdocs.utils' has no attribute 'string_types'

I believe I have installed the right dependencies

pip list | grep cairo
cairocffi                                         1.1.0
pycairo                                           1.18.0

On the Debian machine I have even installed the library as seen into https://www.cairographics.org/download/

sudo apt-get install libcairo2-dev

But for the moment nothing seems to be working.

Maybe you can give me a hint on how to deal with it !

lzpons avatar May 01 '20 22:05 lzpons

This fixes it for me. It's dirty an you should only use this if you understand what it's doing:

sed -i '/usr/local/lib/python3.8/site-packages/mkdocs_pdf_export_plugin/plugin.py' \
    -e 's/^from mkdocs import utils$//g' \
    -e 's/utils.string_types/str/g'

wenergy-turajpilehvar avatar May 19 '20 03:05 wenergy-turajpilehvar

Thank you for the tip,

I am using Anaconda distribution, so my path is /Applications/anaconda3/lib/python3.6/site-packages/mkdocs_pdf_export_plugin/plugin.py

into this file there is an import line from mkdocs import utilsbut it does not seem to be used. In particular I am not finding the utils.string_types plugin.py.zip

lzpons avatar May 23 '20 22:05 lzpons