Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'requests'

I have installed the pip3 as well as requests package in my pc.Even then on running the command import requests on my shell,i am getting the following error:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'

I have to manually copy all the packages to my working directory to tackle this exception.

like image 944
Jaskunwar singh Avatar asked Jul 04 '17 20:07

Jaskunwar singh


3 Answers

Find were your python is installed and find Scripts directory. Open cmd, go to this folder and type pip install requests.

For me it was like below:

cd C:\Users\myLocalUserName\AppData\Local\Programs\Python\Python36\Scripts
pip install requests
like image 179
Hawlett Avatar answered Oct 21 '22 05:10

Hawlett


For listing instaled modules for Python 3:

sudo pip3 list

For installing the request module for Python 3:

sudo pip3 install requests
like image 2
simhumileco Avatar answered Oct 21 '22 04:10

simhumileco


In PyCharm you should:

  1. Go back to base configuration in "File" - "Settings" - "Python Interpreteter" (it is the path that ends with "...\python.exe")
  2. Click on the plus and install this module by typing name in search field.
  3. Choose this configuration and run it by pressing Ctrl+Alt+F10
like image 1
Серёга Британ Avatar answered Oct 21 '22 05:10

Серёга Британ