Django: ModuleNotFoundError: No module named 'requests'

when i run server i have below error:

ModuleNotFoundError: No module named 'requests'

but requests have been installed on my system, when i run sudo pip3 install requests command, output is :

Requirement already satisfied: requests in /home/sadegh-khan/.local/lib/python3.6/site-packages

the terminal pic of my error and command to install requests is: ModuleNotFoundEr

1 answer

  • answered 2018-04-14 15:43 Daniel Roseman

    You're installing requests by running pip as sudo, which means it is installed globally. Yet your screenshot (and please don't post screenshots anyway) shows you are inside a virtualenv, .venv.

    Don't use sudo; just install requests inside the venv.