Friday, January 9, 2015

How to install Python module or library in Windows, Mac and Linux

Usually module source distribution are in *.tar.gz or zip format. In windows you can’t directly unpack the tar.gz format. However you can using 7-Zip free tool you can unzip this format. The following image show how to unzip tar.gz format in Windows. We have to unzip twice.

You should always run the setup command from the distribution root directory, i.e. the top-level subdirectory that the module source distribution unpacks into. For example, if you’ve just downloaded a module source distribution bottle-0.12.8.tar.gz onto a Unix system, the normal thing to do is:
gunzip -c bottle-0.12.8.tar.gz | tar xf -    # unpacks into directory foo-1.0
cd bottle-0.12.8
python setup.py install
On Windows, you’d probably download bottle-0.12.8.zip. If you downloaded the archive file to C:\, then it would unpack into C:\ bottle-0.12.8; you can use either a archive manipulator with a graphical user interface (such as WinZip/7-Zip) or a command-line tool (such as unzip or pkunzip) to unpack the archive. Then, open a command prompt window and run:
cd c:\ bottle-0.12.8
python setup.py install


The following images shows how to install module after unpack.

Cheers!
Uma

No comments:

Post a Comment