ImportError: Reportlab Version 2.1+ is needed
By Güngör Budak
- One minute read - 63 wordsLittle bug in xhtml2pdf version 0.0.5. To fix:
$ sudo nano /usr/local/lib/python2.7/dist-packages/xhtml2pdf/util.py
Change the following lines:
1if not (reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"):
2 raise ImportError("Reportlab Version 2.1+ is needed!")
3
4REPORTLAB22 = (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2")
With these lines:
1if not (reportlab.Version[:3] >= "2.1"):
2 raise ImportError("Reportlab Version 2.1+ is needed!")
3
4REPORTLAB22 = (reportlab.Version[:3] >= "2.1")