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

Time:10-16

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?

CodePudding user response:

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/

  • Related