0

Here is what I'm using:

  • Python 3.7.x on PyCharm 2018.2.4
  • Windows 10.

I'm following a tutorial about website parsing, but the struggle begins before I can even really start out. I get the error message:

ModuleNotFoundError: No module named 'requests'

The package should be installed properly (pip3 install requests) and I run only that single version of python as far aI i know. I can find the package in the directory I'd expect it to be (C:\Users\Bob\AppData\Local\Programs\Python\Python37\Lib\site-packages). I expect the same problem for the other package (beautifulsoup4), but the script doesn't even get that "far".

So, I'm aware that I must've done something incorrectly but I can't figure out what.

Any advice?

Nazim Kerimbekov
  • 4,712
  • 8
  • 34
  • 58
Freakay
  • 3
  • 2
  • is the directory on your path? Also: [check this](https://stackoverflow.com/questions/52485162/pycharm-not-recognizing-installed-beautifulsoup4-module?rq=1) – warped May 13 '19 at 21:56
  • For the sake of ... this worked without any problem. But what did I do wrong before? I did see 2 packages before and now there's a whole list of them, including requests and beautifulsoup. – Freakay May 13 '19 at 22:08

1 Answers1

0

requests is a module which is needed for the script / the command you are trying to run but seems not to be part of the python installation or the python distribution you choose.

I can guess that you got the error while entering the following line:

>>> import requests

I would run the pip install request command from powershell and try to install the package:

python -m pip install requests

I do not know what you want to use python for but I usually advise to use a python distribution such as Anaconda which contains plenty of additional packages including requests.

AlexP
  • 86
  • 1
  • 4
  • Right, importing was the problem. But I (thought I) installed it from powershell when I typed "pip3 install requests". Obviously it didn't work, though. The problem was solved by warped's approach, now I need to figure out what I did wrong to avoid this from happening again. – Freakay May 13 '19 at 22:14