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

How to use APIs with Python Forum

View Course

816 points
609024dbfb4b0abbee11e76ab4d0eaad?s=140&d=retro
Submitted by
Allen Preveaux
over 3 years ago

import requests

when I try to apply this to my local python implementation the interpreter returns:

 Traceback (most recent call last):
  File "C:/programmingFiles/API practice", line 1, in <module>
    import requests
ImportError: No module named requests

What did I miss?


1 vote

permalink

The intalation is more simple than it appears in the docs. Just one in in the command line.
On Linux or OS X:

pip install -U pip

On Windows:

python -m pip install -U pip

This installs and upgrades pip , efficient Python package management and installation module.

Then requests can be installed by another command line one liner:

 pip install requests

1741 points
C8c8ab3c5958df1cd8c2b78bc6db2664?s=140&d=retro
Submitted by
Tomas
over 3 years ago


0 votes

permalink

You need to install requests on your computer first. Instructions are on their website.
Before this you will probably need to install Python package installer pip (link is on the requests site too.)

1741 points
C8c8ab3c5958df1cd8c2b78bc6db2664?s=140&d=retro
Submitted by
Tomas
over 3 years ago


0 votes

permalink

Anyone know of step by step instructions on how to do this? As a newbie the instructions provided by pip and requests on how to install them is over my head (and I would imagine over the head of other newbies).

339 points
E8a9dfb02f0ca6d296851651d2049778?s=140&d=retro
Submitted by
NewtBuggs
over 3 years ago