This forum is now read-only. Please use our new forums at discuss.codecademy.com.

How to use APIs with Python Forum

View Course

532 points
907cea2c476317eb8809922dd575eb69?s=140&d=retro
Submitted by
Mohammad Mostafa kamal
about 4 years ago

ImportError: No module named requests in Codecademy python Lab

Hi Everyone,

When I am trying to run the following code in the codecademy lab phython(python lab) section , I am receiving the following error:

"ImportError: No module named requests"

Can someone please come up with theway around
Thanks in advance

Code goes here:

########## Example request #############
# POST /learn-http HTTP/1.1
# Host: www.codecademy.com
# Content-Type: text/html; charset=UTF-8
# Name=Eric&Age=26

import requests

body = {'Name': 'Eric', 'Age': '26'}

# Make the POST request here, passing body as the data:
response = requests.post("http://codecademy.com/learn-http/",data = body)


1 vote

permalink

Check your spelling. I didn't but you should because you never know!

572 points
54bbc4a99113cb9116003ab6_938228051
Submitted by
Kewlgirl88
over 2 years ago