python setup.py install
The problem is, how do you do this in a Windows-based PC? I tried the following but it didn't work:
- Open a command prompt by type "cmd" at the "Run..." option from the start menu (I'm using Windows XP)
- Navigate to the folder where we have downloaded our Python module
- Type python setup.py install
'python' is not recognized as an internal or external command, operable program or batch file.
The problem is that the path of the executable python.exe is not listed in the PATH environment variable. I went round the problem by typing the exact location of the executable:
C:\python27\python setup.py install
But then I got another error! It turns out that the package I wanted to install requires another package called setuptools... back to the drawing board.
Fortunately I found documentation about setuptools. The module is packaged for a range of distributions including Windows, I only need to run its executable to install the package. And the good thing of this module is that provides a program called easy_install, which is located in C:\Python27\scripts. With this program you can actually install many other packages. It will download the package, install it, and solve any possible dependencies by downloading and installing additional packages.
So, to install a new Python package, say, suds, in a Windows PC, my current sequence of steps was:
- Open a command prompt as before.
- Type C:\Python27\scripts\easy_install suds
End of story! and it works! for me, anyway. You can find additional documentation about easy_install here.