python 3.x – ModuleNotFoundError: No module named requests. But requests already installed

python 3.x – ModuleNotFoundError: No module named requests. But requests already installed

Try to uninstall requests and then again install it using pip

pip uninstall requests

and again install it

pip install requests

or if you didnt get what I am saying so please visit

https://scmquest.com/resolved-importerror-no-module-named-requests-usr-bin-python-no-module-named-pip-on-macos/

If youre using PyCharm as IDE, try closing and restarting PyCharm. Move the mouse cursor over the requests (with red curly line beneath it), until the red light bulb next to it show up. Select the first option in it, Install package requests. PyCharm will take care of the installation from there.

I ran into the same issue and have tried all the solutions here on Stack Overflow.

python 3.x – ModuleNotFoundError: No module named requests. But requests already installed

If it is installed this will WORK:

c:>python  (or on Mac/Linux $ python)
>>> import requests
>>> requests.get(http://127.0.0.1)
<Response [200]>

If you see this error when running your script/IDE:

Traceback (most recent call last): File E:test.py, line 1, in <module>

import requests
ImportError: No module named requests

Try:

python script.py

Answer is based on https://www.edureka.co/community/84584/python-requests-module-import-error-module-named-requests

Then the trick for me was not to start up a VirtualEnv, I actually found I was running the x64 version of python when Id installed the requests package into the python 32 bit folder c:program files (x86)python37-32libsite-packages. This is a screenshot from the internet but it shows you how to change the interpreter youre using – in my case – I need to set it to Python 3.7.4(x86) 32 bit:

enter

Leave a Reply

Your email address will not be published. Required fields are marked *