19

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

B8vrede
  • 4,432
  • 3
  • 27
  • 40
DeltaG
  • 760
  • 2
  • 9
  • 28
  • Could you add some extra info, like which version of reportlab is installed (`reportlab.__version__`) and which Python version you are using? And did you already try `pip install --upgrade --force-reinstall reportlab`? – B8vrede Aug 04 '16 at 07:46
  • 1
    The force reinstall worked! I had installed pillow through a long series of smaller packages, and it looks like something broke in there. When I did the force-reinstall, it fixed pillow and reportlab. Write up an answer below, and I'll accept - thanks! – DeltaG Aug 04 '16 at 13:55

6 Answers6

29

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
B8vrede
  • 4,432
  • 3
  • 27
  • 40
  • Did not work for me: When I try this it uninstalls pip half way through, that breaks things as pip becomes an unknown module. – Jay M Feb 02 '18 at 13:42
2

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

Ronald Saunfe
  • 561
  • 6
  • 20
0

Download the latest version of python, ensure it's a 64-bit python package, and change the python interpreter in VSC.

View - Command Pallette - Type "Select Interpreter" - Click it and choose for example "Python 3.8.0 64-bit"

It's also a good idea to install the latest version:

pip install reportlab==3.6.11
Conor
  • 327
  • 6
  • 15
0

Check if you have 2 versions of Python - That is 2.7 and 3 - in which case you would need to run pip3 instead of pip to run Python3 code

-1

The best way to install ReportLab is use their .exe installer. They have installers for 32bit and 64bit.
https://pypi.org/project/reportlab/2.7/

DeltaG
  • 760
  • 2
  • 9
  • 28
Donny V.
  • 22,248
  • 13
  • 65
  • 79
-1

may be you are missing the module try below command for the same:

pip install --upgrade --force-reinstall reportlab