Getting this error when trying to run a Python script. I have downloaded a requests-1.2.0 folder but I have no idea what to do with it. I\'ve tried running the setup.py file con
from the root directory of the requests folder you downloaded, run:
$ python setup.py install
then it will be installed system-wide, and your scripts may use "import requests"
You need to install it for the same version of Python that you're using to run your script. The setup.py
tells Python how to do that, so you can open up a command line to that directory (do you know how to do that?) and type python setup.py install
to install it.
But there's a much easier way -- Python has an excellent package manager, called pip. You can use that to install any other Python packages that you want by typing pip install requests
at the command line. In particular, it will connect to the internet and work out what to download, then download and install it?
You need to run setup.py with the "install" argument. That will install requests in the site-packages folder where it can be imported globally.
Open a cmd window and navigate to the requests folder that you downloaded. Then type the following into the cmd window:
C:\python27\python.exe setup.py install
You'll need to change the path to the python executable to match that for your system, of course.
PS: You're going to love requests!