How do I install Python packages on Windows?
The accepted answer is outdated. So first, pip
is preferred over easy_install
, (Why use pip over easy_install?). Then follow these steps to install pip
on Windows, it's quite easy.
Install
setuptools
:curl https://bootstrap.pypa.io/ez_setup.py | python
Install
pip
:curl https://bootstrap.pypa.io/get-pip.py | python
Optionally, you can add the path to your environment so that you can use
pip
anywhere. It's somewhere likeC:\Python33\Scripts
.
Newer versions of Python for Windows come with the pip package manager. (source)
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
Use that to install packages:
cd C:\Python\Scripts\
pip.exe install <package-name>
So in your case it'd be:
pip.exe install mechanize