Running python files from command prompt
Question: I have written a python program in eclipse that imports the mechanize module.
It works perfectly there. When I run the .py file from the command prompt, it
shows this error: "No module named mechanize". How do I rectify this?


Answer: Make sure that Eclipse and prompt are using the same python version. Simply
typing $ python on the command line show you the version you are using from
there.

The mechanize module must be in your site-packages folder in order for python
to find it.

(C:\Python\Lib\site-packages)

If the module is not in your site-packages folder then you can install it as
follows:

Download the source code from
<http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.tar.gz>

Now extract and install the package (This is what you do on Linux, on Mac or
Win. this might be slightly different)

$ tar zxvf mechanize-0.2.5.tar.gz)

$ sudo python setup.py install

