Import requests working on Windows shell but not in PyCharm

Question:

The simple import of requests

import requests

can be executes and used in windows shell but the same code says in pycharm:

Traceback (most recent call last):
  File "C:/Users/XPS13/PycharmProjects/Testing/Webcrawler_Test.py", line 1, in 
<module>
    import requests
ModuleNotFoundError: No module named 'requests'

requests was correctly pip installed. Even uninstalling and reinstalling doesn’t work.

Any help would be appreciated.

Asked By: magic.dave

||

Answers:

You need to configure the project interpreter in PyCharm:

  • Go to Settings/Preferences
  • Select Project Interpreter
  • Click the little gear and click Add…
  • Select the appropriate interpreter (whether a virtual environment or system python installation)
Answered By: Arthur Dent

Yeah so this might be a little late but I fixed my problem like this:

  • Go to Settings/Preferences
  • Select Project Interpreter
  • And press the + button on the left side

That + sign

  • Search for requests
  • And press Install Package

I am running:
Windows 10
Python 3.7.1

Answered By: Nazrin Harris

enter image description here

  1. Settings top right
  2. ‘+’ above Package table
  3. Search: Requests & highlight in list
  4. Install Package

enter image description here

Answered By: Andre Nel