Getting a import module not found error even though it is there when I do pip3 list?

Question:

I am trying to run a script but am getting an import error even though I have the module installed.

So I am in my own venv and here is some of the code I am trying to run:

import pyscreenshot as ImageGrab
# fullscreen
im=ImageGrab.grab()
im.show()

However I am getting an error that ModuleNotFoundError: No module named 'pyscreenshot'

But when I do a pip3 list, pyscreenshot is there at version 3.0, however it is not there when I do a pip list – is this what is causing the import error?

Asked By: Patrick Chong

||

Answers:

Did you add to settings.py file in your project? If you do not, you have to add before try to use it.

You must add yo installed apps section like this :

INSTALLED_APPS = [
...
'polls.apps.PollsAppConfig',
...

]

https://docs.djangoproject.com/en/4.1/ref/applications/

Answered By: Tolga Yavuzer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.