Import Python Reportlab

Asked

Viewed 132 times

2

Hello, I’m trying to import the following lib in my Python project 2.7:

from reportlab.lib.rparsexml import simpleparse

Error:

Import: No module named reportlab.lib.rparsexml

I tried to install the python-reportlab:

python-reportlab is already the Newest version.

Note: I am using the virtualenv.

  • It is likely that you have installed reportlab in the virtual environment but your project is not connected to virtualenv

  • In the terminal activate your virtual environment, type python in the terminal and try to import the module import reportlab, successfully care that your project is not configured to run in the environment.

1 answer

1


Usually this type of error happens when using a different Python than the Python in which lib was installed.

How are you using virtualenv, check that the virtualenv of your project is enabled before installing lib. When running your project, also confirm that it will run with virtualenv Python.

  • 1

    Thank you all for your help. I found my error. virtualenv was turned on and working correctly. virtualenv was unable to see lib python-reportlab because I installed it with apt-get install.. so virtualenv couldn’t see lib. I installed lib with pip install reportlab and it worked.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.