How to install mechanize for Python 2.7?

advertisements

I saved mechanize in my Python 2.7 directory. But when I type import mechanize into the Python shell, I get an error message that reads:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import mechanize
ImportError: No module named mechanize


using pip:

pip install mechanize

or download the mechanize distribution archive, open it, and run:

python setup.py install