#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 )
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 6 years ago by
| Description: | modified (diff) |
|---|
comment:2 Changed 6 years ago by
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
comment:3 Changed 6 years ago by
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.
comment:4 Changed 6 years ago by
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 6 years ago by
I got it solved by adding this line to the uwsgi ini file:
pythonpath = /mnt/data/trac/.local/lib64/python2.7/site-packages



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.