Time for action – installing the Requests library
We stated before that Python mainly aims at simplicity and code readability, but unfortunately this is not always the case. Interacting with REST using the standard Python libraries can be painfully laborious. Luckily, there is an open source project that can solve this. The project produced a library called Requests, and I have to say it really is an appropriate name. So let's install it!
As the first step, you need to download the ZIP or TAR archive containing the library code:
~$ wget https://github.com/kennethreitz/requests/tarball/master -O master.tar.gz ~$ ls -al drwxrwxr-x 2 stefano stefano 4096 Oct 15 08:01 ./ drwxr-xr-x 9 stefano stefano 4096 Oct 15 07:41 ../ -rw-rw-r-- 1 stefano stefano 720204 Oct 15 08:02 master.tar.gz
Now extract the archive content:
~$ tar xvfz master.tar.gz …
Enter the new folder and install it into your site package:
~$ cd kennethreitz-requests-c03e893 ~$ sudo python setup.py install
Installation is now...