python - mac - How do I install pip on Windows?
upgrade pip windows (20)
On Windows, simply download and install first
pip from the above links. The
distribute link above does contain stub
.exe installers, and these are currently 32-bit only. I haven't tested the effect on 64-bit Windows.
Building on Windows
The process to redo this for new versions is not difficult, and I've included it here for reference.
In order to get the stub
.exe files, you need to have a Visual C++ compiler (it is apparently compilable with MinGW as well)
hg clone https://bitbucket.org/tarek/distribute cd distribute hg checkout 0.6.27 rem optionally, comment out tag_build and tag_svn_revision in setup.cfg msvc-build-launcher.cmd python setup.py bdist_win32 cd .. echo build is in distribute\dist
git clone https://github.com/pypa/pip.git cd pip git checkout 1.1 python setup.py bdist_win32 cd .. echo build is in pip\dist
Python 2.7.9+ and 3.4+
Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip. This is the best feature of any Python release. It makes the community's wealth of libraries accessible to everyone. Newbies are no longer excluded from using community libraries by the prohibitive difficulty of setup. In shipping with a package manager, Python joins Ruby, Node.js, Haskell, Perl, Go--almost every other contemporary language with a majority open-source community. Thank you Python.
Of course, that doesn't mean Python packaging is problem solved. The experience remains frustrating. I discuss this in question Does Python have a package/module management system?.
And, alas for everyone using Python 2.7.8 or earlier (a sizable portion of the community). There's no plan to ship Pip to you. Manual instructions follow.
Python 2 ≤ 2.7.8 and Python 3 ≤ 3.3
Flying in the face of its 'batteries included' motto, Python ships without a package manager. To make matters worse, Pip was--until recently--ironically difficult to install.
get-pip.py, being careful to save it as a
.py file rather than
.txt. Then, run it from the command prompt:
You possibly need an administrator command prompt to do this. Follow Start a Command Prompt as an Administrator (Microsoft TechNet).
This installs the pip package, which (in Windows) contains ...\Scripts\pip.exe that path must be in PATH environment variable to use pip from the command line (see the second part of 'Alternative Instructions' for adding it to your PATH,
The official documentation tells users to install Pip and each of its dependencies from source. That's tedious for the experienced and prohibitively difficult for newbies.
For our sake, Christoph Gohlke prepares Windows installers (
.msi) for popular Python packages. He builds installers for all Python versions, both 32 and 64 bit. You need to:
For me, this installed Pip at
pip.exe on your computer, then add its folder (for example,
C:\Python27\Scripts) to your path (Start / Edit environment variables). Now you should be able to run
pip from the command line. Try installing a package:
pip install httpie
There you go (hopefully)! Solutions for common problems are given below:
If you work in an office, you might be behind an HTTP proxy. If so, set the environment variables
https_proxy. Most Python applications (and other free software) respect these. Example syntax:
http://proxy_url:port http://username:[email protected]_url:port
If you're really unlucky, your proxy might be a Microsoft NTLM proxy. Free software can't cope. The only solution is to install a free software friendly proxy that forwards to the nasty proxy. http://cntlm.sourceforge.net/
Unable to find vcvarsall.bat
Python modules can be partly written in C or C++. Pip tries to compile from source. If you don't have a C/C++ compiler installed and configured, you'll see this cryptic error message.
Error: Unable to find vcvarsall.bat
Often though it's easier to check Christoph's site for your package.
-- Outdated -- use distribute, not setuptools as described here. --
-- Outdated #2 -- use setuptools as distribute is deprecated.
As you mentioned pip doesn't include an independent installer, but you can install it with its predecessor easy_install.
- Download the last pip version from here: http://pypi.python.org/pypi/pip#downloads
- Uncompress it
- Download the last easy installer for Windows: (download the .exe at the bottom of http://pypi.python.org/pypi/setuptools ). Install it.
- copy the uncompressed pip folder content into
C:\Python2x\folder (don't copy the whole folder into it, just the content), because python command doesn't work outside
C:\Python2xfolder and then run:
python setup.py install
- Add your python
C:\Python2x\Scriptsto the path
You are done.
Now you can use
pip install package to easily install packages as in Linux :)
These answers are outdated or otherwise wordy and difficult.
If you've got Python 3.4+ or 2.7.9+, it will be installed by default on Windows. Otherwise, in short:
- Download the pip installer: https://bootstrap.pypa.io/get-pip.py
- If paranoid, inspect file to confirm it isn't malicious (must b64 decode).
- Open a console in the download folder as Admin and run
get-pip.py. Alternatively, right-click its icon in Explorer and choose the "run as Admin...".
The new binaries
pip.exe (and the deprecated
easy_install.exe) will be found in the
"%ProgramFiles%\PythonXX\Scripts" folder (or similar), which is likely not in your
PATH variable. I recommend adding it.
For latest Python Download - I have python 3.6 on windows. You don't have to wonder everything you need is there , take a breath i will show you how to do it.
Now , lets add python and pip into environment variable path settings if you are on windows, so that typing pip or python anywhere call python aor pip from where they are installed.
Almost Done , Let test with CMD to install goole package using pip.
pip install google
Updated at 2016 :
Pip should already be included in
Python 2.7.9+ or 3.4+, but if for whatever reason it is not there, you can use the following one-liner.
- Download https://bootstrap.pypa.io/get-pip.py and run it with Administrator permission
python get-pip.py(If you are on Linux, use
sudo python get-pip.py)
This should already be satisfied in most cases but, if necessary, be sure that your environment variable PATH includes Python's folders (for example,
Python 2.7.xon Windows default install:
C:\Python27 and C:\Python27\Scripts, for
C:\Python33 and C:\Python33\Scripts, etc)
I encounter same problem and then found such perhaps easiest way (one liner!) mentioned on official website here: http://www.pip-installer.org/en/latest/installing.html
Can't believe there are so many lengthy (perhaps outdated?) answers out there. Feeling thankful to them but, please up-vote this short answer to help more new comers!
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4 binaries downloaded from python.org, but you'll need to upgrade pip.
On Windows upgrade can be done easily
Go to Python command line and run below Python command
python -m pip install -U pip
Installing with get-pip.py
Download get-pip.py in the same folder or any other folder of your choice. I am assuming you will download it in the same folder from you have python.exe file and run this command
Pip's installation guide is pretty clean and simple.
Using this you should be able to get started with Pip in under two minutes.
Here how to install pip with easy way.
- copy and paste these content in a file as get-pip.py
- copy and paste get-pip.py into python folder.
- Double click to get-pip.py file.it will install pip to your computer.
- Now you have to add
C:\Python27\Scriptspath to your enviroment variable.Because it includes
- Now you are ready to use pip. Open
cmdand type as
pip install package_name
How to install pip:
- Download and install ActivePython
- Open a command prompt (CMD)
pypm install pip
I just wanted to add one more solution for those having issues installing setuptools from Windows 64-bit. The issue is discussed in this bug on python.org and is still unresolved as of the date of this comment. A simple workaround is mentioned and it works flawlessly. One registry change did the trick for me.
Solution that worked for me...:
Add this registry setting for 2.6+ versions of Python:
This is most likely the registry setting you will already have for Python 2.6+:
Clearly, you will need to replace the 2.6 version with whatever version of Python you are running.
I think the question makes it seem like the answer is simpler than it really is. Running of pip will sometimes require native compilation of a module (64-bit Numpy is a common example of that). In order for pip's compilation to succeed, you need Python which was compiled with the same version of MSVC as the one pip is using. Standard Python distributions are compiled with MSVC 2008. You can install an Express version of VC2008, but it is not maintained. Your best bet is to get an express version of a later MSVC and compile Python. Then PIP and Python will be using the same MSVC version.
It's very simple:
Step 1: wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py Step 2: wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py Step 2: python ez_setup.py Step 3: python get-pip.py
(Make sure your Python and Python script directory (for example,
C:\Python27\Scripts) are in the PATH.)
Just download setuptools-15.2.zip (md5), from here https://pypi.python.org/pypi/setuptools#windows-simplified , and run ez_setup.py.
The best way I found so far, is just two lines of code:
curl http://python-distribute.org/distribute_setup.py | python curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
And you probably want to add the path to your environment. It's somewhere like
The following works for Python 2.7. Save this script and launch it:
Pip is installed, then add the path to your environment :
pip install virtualenv
Also you need Microsoft Visual C++ 2008 Express to get the good compiler and avoid these kind of messages when installing packages:
error: Unable to find vcvarsall.bat
If you have a 64-bit version of Windows 7, you may read 64-bit Python installation issues on 64-bit Windows 7 to successfully install the Python executable package (issue with registry entries).
To install pip globally on Python 2.x, easy_install appears to be the best solution as Adrián states.
However the installation instructions for pip recommend using virtualenv since every virtualenv has pip installed in it automatically. This does not require root access or modify your system Python installation.
Installing virtualenv still requires easy_install though.
Python 3.3+ now includes the venv module for easily creating virtual environments like so:
python3 -m venv /path/to/new/virtual/environment
See documentation for different platform methods of activating the environment after creation, but typically one of:
$ source <venv>/bin/activate C:\> <venv>\Scripts\activate.bat
To use pip, it is not mandatory that you need to install pip in the system directly. You can use it through
virtualenv. What you can do is follow these steps:
- Download virtualenv tar.gz file from https://pypi.python.org/pypi/virtualenv
- Unzip it with 7zip or some other tool
We normally need to install Python packages for one particular project. So, now create a project folder, let’s say myproject.
- Copy the virtualenv.py file from the decompressed folder of
virtualenv, and paste inside the myproject folder
Now create a virtual environment, let’s say myvirtualenv as follows, inside the myproject folder:
python virtualenv.py myvirtualenv
It will show you:
New python executable in myvirtualenv\Scripts\python.exe Installing setuptools....................................done. Installing pip.........................done.
Now your virtual environment, myvirtualenv, is created inside your project folder. You might notice, pip is now installed inside you virtual environment. All you need to do is activate the virtual environment with the following command.
You will see the following at the command prompt:
(myvirtualenv) PATH\TO\YOUR\PROJECT\FOLDER>pip install package_name
Now you can start using pip, but make sure you have activated the virtualenv looking at the left of your prompt.
This is one of the easiest way to install pip i.e. inside virtual environment, but you need to have virtualenv.py file with you.
For more ways to install pip/virtualenv/virtualenvwrapper, you can refer to thegauraw.tumblr.com.
Working as of Feb 04 2014 :):
If you have tried installing pip through the Windows installer file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip as suggested by @Colonel Panic, you might have installed the pip package manager successfully, but you might be unable to install any packages with pip. You might also have got the same SSL error as I got when I tried to install Beautiful Soup 4 if you look in the pip.log file:
Downloading/unpacking beautifulsoup4 Getting page https://pypi.python.org/simple/beautifulsoup4/ Could not fetch URL https://pypi.python.org/simple/beautifulsoup4/: **connection error: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed** Will skip URL https://pypi.python.org/simple/beautifulsoup4/ when looking for download links for beautifulsoup4
Installing Pip on Windows:
- Download pip 1.2.1 from https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
- Extract the pip-1.2.1.tar.gz file
- Change directory to the extracted folder:
cd <path to extracted folder>/pip-1.2.1
python setup.py install
- Now make sure
C:\Python27\Scriptsis in PATH because pip is installed in the
C:\Python27\Lib\site-packageswhere Python packages are normally installed
Now try to install any package using pip.
For example, to install the
requests package using pip, run this from cmd:
pip install requests
requests will be successfully installed and you will get a success message.
if you even have other problems with pip version you can try this
pip install --trusted-host pypi.python.org --upgrade pip