Skip to content
Related Articles
Get the best out of our app
Open App

Related Articles

How to Install mechanize for Python?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, we are going to install mechanize for Python. Mechanize was designed by John J. Lee. and Maintenance take over by Kovid Goyal in 2017. It follows the Stateful programmatic web browsing in Python

Features of mechanize module

  • Mechanize browser implements the interface of urllib2.OpenerDirector
  • It has function/methods to HTML form filling
  • Tracking easily Browser history
  • Automatic handling of HTTP-Equiv and Refresh
  • Obtained link parsing
  • urllib2 function exist inside the mechanize


In Windows

PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “on-line repository” termed as Python Package Index (PyPI). If PIP is not present, go through How to install PIP on Windows? and follow the instructions provided.

Mechanize can be directly downloaded and installed with the use of pip (package manager). To install mechanize, just go to the command line and type the following command:

pip install mechanize

In Linux

You can install mechanize using pip as well as apt-get command in Linux. To install using pip type the below command in the terminal. 

pip3 install mechanize

To install using the apt type the below command in the terminal.

sudo apt-get install python-mechanize

Installing from Github

To install from github we need to clone the repo into our system. To clone the repo and then install it type the below command in the terminal.

git clone
cd mechanize
pip3 install -e


mechanize exports the complete interface using mechanize.urlopen() methods.


# import module
import mechanize
# read url with urlopen()
response = mechanize.urlopen("")






My Personal Notes arrow_drop_up
Last Updated : 22 Feb, 2022
Like Article
Save Article
Similar Reads
Related Tutorials