Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installation: Reportlab: "ImportError: No module named reportlab.lib"

I've installed reportlab, via

pip install reportlab

(also tried via

easy_install reportlab

)

..but I get the above error. There are other RL imports before that - it's the .lib that it's objecting to. I've had RL working great in the past, but IT reimaged my computer, and I'm trying to rebuild it. The script works fine, but there's something funky with the RL install, I think.

Reportlab: 3.3.0

like image 497
DeltaG Avatar asked Aug 02 '16 03:08

DeltaG


2 Answers

Most of the times errors like this are caused by an broken package, either in the package it self or in one of it's dependencies.

The best way to resolve such a issue is to force-reinstall the package, it will reinstall the package and its dependencies potentially repairing the package.

To force-reinstall reportlab use:

pip install --upgrade --force-reinstall reportlab
like image 66
B8vrede Avatar answered Sep 30 '22 13:09

B8vrede


If the above solution doesn't work for you then make sure you dont have any other module named reportlab.py in your current directory. Another alternative you can do this in windows commandline

pip uninstall reportlab

then create an account for reportlab here is the link https://www.reportlab.com/accounts/register/ then copy paste this in the windows commandline

pip install -ihttps://www.reportlab.com/pypi -U reportlab

when it prompts you for a user and password use the one you just registered

like image 35
Ronald Saunfe Avatar answered Sep 30 '22 11:09

Ronald Saunfe