Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) come with Pip. This is the best feature of a Python release. It makes the total number of community libraries accessible to all. Novices are not excluded from using the community libraries with the prohibitive limitations of their configuration. Released with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go... almost all of the contemporary languages with a majority open-source community. Thanks Python.
Of course, that doesn't mean that the problem of generating packages in Python is solved. The experience is still frustrating. This was discussed (in English) here .
And for those using Python 2.7.8 or earlier (most of the community), there are no plans to release Pip for you. Manual instructions below.
Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3
Python doesn't come with a package manager. And to make matters worse, Pip, until recently, was difficult to install.
Download get-pip.py , being careful to save it as a file with a .py extension instead of a .txt. Then run it from the command line:
python get-pip.py
Administrator permissions may be required to do this. If you don't know how, here are the instructions (in English) (Microsoft TechNet).
Alternative Instructions
The official documentation says to install Pip and each of its dependencies from source. This is a tedious and very difficult experience for beginners.
Luckily, Christoph Gohlke prepared Windows installer packages (.msi) for popular Python packages. He built installers for all versions of Python, both 32-bit and 64-bit.
In the tested case, this installed Pip in C:\Python27\Scripts\pip.exe. Find where it was installed pip.exeon your computer, and then add that folder (eg C:\Python27\Scripts) to the path string (start/edit environment variables). With this, you should be able to run pip from the command line. Now you could try installing a package:
pip install httpie
If all went well, this should work fine. Below are some common problems:
proxy issues
If you work in an office, you are probably behind a proxy. If so, you need to set the environment variables http_proxy and https_proxy . Most Python (and other free software) applications respect this.
With a lot of bad luck, if the proxy is of the type Microsoft NTLM , free software applications can't handle it. In that case, the only solution is to install a proxy that connects to that proxy. try this one
Cannot find vcvarsall.bat
Python modules may be partly written in C or C++. Pip tries to compile from source code. If there is no C/C++ compiler configured and installed, this error will appear.
The best solution is to use "conda" . It is the de facto standard way of installing packages on windows.
You have it in two versions: anaconda , a complete python distribution oriented to scientific uses, and miniconda , a reduced version to which you can add the packages you need.
Conda has a large collection of pre-compiled packages available that are ready to install. If you still can't find the one you need, the installation also includes pip with which to install other packages.
One recommendation: before installing anything with pip, create a virtual python environment where you can install the module you need. Try not to pollute the main installation.
Python 2.7.9+ and 3.4+
Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) come with Pip. This is the best feature of a Python release. It makes the total number of community libraries accessible to all. Novices are not excluded from using the community libraries with the prohibitive limitations of their configuration. Released with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go... almost all of the contemporary languages with a majority open-source community. Thanks Python.
Of course, that doesn't mean that the problem of generating packages in Python is solved. The experience is still frustrating. This was discussed (in English) here .
And for those using Python 2.7.8 or earlier (most of the community), there are no plans to release Pip for you. Manual instructions below.
Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3
Python doesn't come with a package manager. And to make matters worse, Pip, until recently, was difficult to install.
Official instructions .
Download get-pip.py , being careful to save it as a file with a .py extension instead of a .txt. Then run it from the command line:
Administrator permissions may be required to do this. If you don't know how, here are the instructions (in English) (Microsoft TechNet).
Alternative Instructions
The official documentation says to install Pip and each of its dependencies from source. This is a tedious and very difficult experience for beginners.
Luckily, Christoph Gohlke prepared Windows installer packages (.msi) for popular Python packages. He built installers for all versions of Python, both 32-bit and 64-bit.
The steps to follow are:
In the tested case, this installed Pip in
C:\Python27\Scripts\pip.exe
. Find where it was installedpip.exe
on your computer, and then add that folder (egC:\Python27\Scripts
) to the path string (start/edit environment variables). With this, you should be able to run pip from the command line. Now you could try installing a package:If all went well, this should work fine. Below are some common problems:
proxy issues
If you work in an office, you are probably behind a proxy. If so, you need to set the environment variables http_proxy and https_proxy . Most Python (and other free software) applications respect this.
Example:
With a lot of bad luck, if the proxy is of the type Microsoft NTLM , free software applications can't handle it. In that case, the only solution is to install a proxy that connects to that proxy. try this one
Cannot find vcvarsall.bat
Python modules may be partly written in C or C++. Pip tries to compile from source code. If there is no C/C++ compiler configured and installed, this error will appear.
This can be fixed by installing a C++ compiler like MinGW or Visual C++ . Or you can try Microsoft Visual C++ Compiler for Python 2.7 .
As a final note, it's always easier to check if there isn't an installation package on Christoph's site .
The best solution is to use "conda" . It is the de facto standard way of installing packages on windows.
You have it in two versions: anaconda , a complete python distribution oriented to scientific uses, and miniconda , a reduced version to which you can add the packages you need.
Conda has a large collection of pre-compiled packages available that are ready to install. If you still can't find the one you need, the installation also includes pip with which to install other packages.
One recommendation: before installing anything with pip, create a virtual python environment where you can install the module you need. Try not to pollute the main installation.