Question

I'm trying to install pisa, I have all the requirements installed.

I try import:

import ho.pisa as pisa

or:

import xhtml2pd.pisa as pisa

Error:

ImportError
Exception Value:    

No module named reportlab.lib.units

Last traceback:

from pisa_util import *

from reportlab.lib.units import inch, cm

I'm running in virtual environment. I believe i have all requirements installed.

I did:

sudo apt-get install python-pisa

created test.html, and in command-line:

xhtml2pdf test.html target.pdf

This generate pdf correctly

However:

pip install reportlab
Requirement already satisfied (use --upgrade to upgrade): reportlab in /usr/local/lib/python2.7/dist-packages
Cleaning up...

Still throw error.

Any help is appreciated.

Was it helpful?

Solution

This is the solution by the question's author, moved to the appropriate section.
To question's author: if you want to gain reputation, feel free to write a new answer, then ping me to remove this answer.

Finally fixed the issue.

If you are in virtual environment, you must execute:

pip install reportlab

in the bin directory under project folder, i.e.:

~/.virtualenvs/project/bin

OTHER TIPS

pip install xhtml2pdf

pip install pisa

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top