Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13640 closed task (worksforme)

Where to obtain xhtml2pdf?

Reported by: Massimo Owned by: Álvaro Iradier
Priority: normal Component: TracWikiPrintPlugin
Severity: normal Keywords: xhtml2pdf
Cc: Trac Release: 1.2

Description (last modified by Massimo)

On recent Linux distributions, where do I get the required Python library xhtml2pdf from?

The link http://www.xhtml2pdf.com/ is forwarding to https://www.sejda.com/html-to-pdf today. Searching the packages on Gentoo I find media-gfx/wkhtmltopdf (https://wkhtmltopdf.org/) which is something different I guess.

2019-11-04 11:29:07,289 Trac[loader] DEBUG: Skipping "TracWikiPrintPlugin 2.0.0.dev0": DistributionNotFound: The 'xhtml2pdf' distribution was not found and is required by TracWikiPrintPlugin

Attachments (0)

Change History (5)

comment:1 Changed 5 years ago by Massimo

Description: modified (diff)

comment:2 Changed 5 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

Development of xhtml2pdf is on GitHub. You can use pip install xhtml2pdf. If you want to install through the OS package manager, you'll need to consult the community for xhtml2pdf or the OS.

comment:3 Changed 5 years ago by Massimo

Is it possible to use pip install as trac user only to install into ~trac/ home, for not polluting the root installation?

I tried by

 pip install --user xhtml2pdf

and got

$ tree ~trac/.local/lib64/ -L 3
/mnt/data/trac/.local/lib64/
└── python3.6
    └── site-packages
        ├── PIL
        ├── Pillow-6.2.1.dist-info
        ├── PyPDF2
        ├── PyPDF2-1.26.0-py3.6.egg-info
        ├── reportlab
        ├── reportlab-3.5.32.dist-info
        ├── xhtml2pdf
        └── xhtml2pdf-0.2.3-py3.6.egg-info

But I still get

2019-11-06 11:22:22,359 Trac[loader] DEBUG: Skipping "TracWikiPrintPlugin 2.0.0.dev0": DistributionNotFound: The 'xhtml2pdf' distribution was not found and is required by TracWikiPrintPlugin

The uwsgi workers are running as user trac and should be able to find the python library at $HOME.

Last edited 5 years ago by Massimo (previous) (diff)

comment:4 Changed 5 years ago by Ryan J Ollos

I don't have any experience installing to the user install directory. You might ask on the MailingList.

For not polluting the root installation, virtual environments are a good choice.

comment:5 Changed 5 years ago by Massimo

I got it solved by adding this line to the uwsgi ini file:

pythonpath = /mnt/data/trac/.local/lib64/python2.7/site-packages

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Álvaro Iradier.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.