pip¶
User list | Dev list | Github | PyPI | User IRC: #pip | Dev IRC: #pypa
快速指南¶
首先, 安装pip.
从 PyPI 安装:
$ pip install SomePackage
[...]
Successfully installed SomePackage
查看什么package被安装:
$ pip show --files SomePackage
Name: SomePackage
Version: 1.0
Location: /my/env/lib/pythonx.x/site-packages
Files:
../somepackage/__init__.py
[...]
查看什么package有更新:
$ pip list --outdated
SomePackage (Current: 1.0 Latest: 2.0)
更新新的package:
$ pip install --upgrade SomePackage
[...]
Found existing installation: SomePackage 1.0
Uninstalling SomePackage:
Successfully uninstalled SomePackage
Running setup.py install for SomePackage
Successfully installed SomePackage
卸载已有package:
$ pip uninstall SomePackage
Uninstalling SomePackage:
/my/env/lib/pythonx.x/site-packages/somepackage
Proceed (y/n)? y
Successfully uninstalled SomePackage
安装pip¶
Python和系统版本支持列表¶
pip可以在以下版本的CPython下运行:2.6, 2.7, 3.1, 3.2, 3.3, 3.4 和 pypy.
pip可以在Unix/Linux, OS X 和 Windows系统中运行.
Note
Python 2.5在 v1.3.1版本后支持, Python 2.4在v1.1版本后支持.
使用脚本安装和升级pip¶
要安装或升级pip,需要下载 get-pip.py. [1]
然后运行以下命令 (需要管理员权限):
$ python get-pip.py
如果 setuptools (或 distribute) 未安装, get-pip.py
会
自动为你安装 setuptools . [2]
如果需要升级 setuptools (或 distribute), 运行 pip install -U setuptools
[3]
使用软件管理器安装¶
在Linux系统中,pip通常可以在系统的软件管理器中安装,不过通过此方法安装的 一般不会是最新版本的pip.
Debian 和 Ubuntu:
$ sudo apt-get install python-pip
Fedora:
$ sudo yum install python-pip
[1] | “Secure” in this context means using a modern browser or a tool like curl that verifies SSL certificates when downloading from https URLs. |
[2] | 从 pip v1.5.1开始, 使用 get-pip.py 安装pip不一定需要先安装setuptools. |
[3] | Although using pip install --upgrade setuptools to upgrade from
distribute to setuptools works in isolation, it’s possible to get
“ImportError: No module named setuptools” when using pip<1.4 to upgrade a
package that depends on setuptools or distribute. See here for
details. |
用户手册¶
Contents
安装package¶
pip支持从 PyPI 、版本控制系统、本地项目, 甚至直接通过distribution文件安装package.
最常见的是使用 Requirement Specifiers 从 PyPI 安装。
$ pip install SomePackage # 最新版本 $ pip install SomePackage==1.0.4 # 指定版本 $ pip install 'SomePackage>=1.0.4' # 最低版本
更多详情可以参考 pip install 一节.
Requirements 文件¶
“Requirements 文件”中列出了需要安装的package,并可以通过 pip install 来安装:
pip install -r requirements.txt
这个文件的格式详情可以参考: Requirements File Format.
理论上来说,Requirements只是一个包含了由 pip install 参数排成列表的文件.
实践中,Requirements文件通常有4种作用:
pip freeze 输出的信息保存在Requirements文件中, 主要用于 repeatable installations. In 在这种情况下,requirement文件会包含你运行 pip freeze 命令时各个package的版本信息.
pip freeze > requirements.txt pip install -r requirements.txt
引导pip正确地安装满足需求的package. 由于现在pip 还不具备真正的依赖分析, 只是简单地为项目匹配第一需求. 举个例子:假如 pkg1 需要 pkg3>=1.0, pkg2 需要 pkg3>=1.0,<=2.0, 如果 pkg1 被先安装, 那么pip只会满足 pkg3>=1.0, 这样可能会导致所安装的 pkg3 版本和 pkg2 发生冲突. 如果要解决这个问题,需要把 pkg3>=1.0,<=2.0 (正确的指定) 写入 requirements 文件. 例如:
pkg1 pkg2 pkg3>=1.0,<=2.0
Requirements files are used to force pip to install an alternate version of a sub-dependency. For example, suppose ProjectA in your requirements file requires ProjectB, but the latest version (v1.3) has a bug, you can force pip to accept earlier versions like so:
ProjectA ProjectB<1.3
Requirements files are used to override a dependency with a local patch that lives in version control. For example, suppose a dependency, SomeDependency from PyPI has a bug, and you can’t wait for an upstream fix. You could clone/copy the src, make the fix, and place it in vcs with the tag sometag. You’d reference it in your requirements file with a line like so:
git+https://myvcs.com/some_dependency@sometag#egg=SomeDependency
If SomeDependency was previously a top-level requirement in your requirements file, then replace that line with the new line. If SomeDependency is a sub-dependency, then add the new line.
It’s important to be clear that pip determines package dependencies using install_requires metadata, not by discovering requirements.txt files embedded in projects.
See also:
Installing from Wheels¶
“Wheel” is a built, archive format that can greatly speed installation compared to building and installing from source archives. For more information, see the Wheel docs , PEP427, and PEP425
Pip prefers Wheels where they are available. To disable this, use the –no-use-wheel flag for pip install.
If no satisfactory wheels are found, pip will default to finding source archives.
To install directly from a wheel archive:
pip install SomePackage-1.0-py2.py3-none-any.whl
For the cases where wheels are not available, pip offers pip wheel as a convenience, to build wheels for all your requirements and dependencies.
pip wheel requires the wheel package to be installed, which provides the “bdist_wheel” setuptools extension that it uses.
To build wheels for your requirements and all their dependencies to a local directory:
pip install wheel
pip wheel --wheel-dir=/local/wheels -r requirements.txt
And then to install those requirements just using your local directory of wheels (and not from PyPI):
pip install --no-index --find-links=/local/wheels -r requirements.txt
Uninstalling Packages¶
pip is able to uninstall most packages like so:
$ pip uninstall SomePackage
pip also performs an automatic uninstall of an old version of a package before upgrading to a newer version.
For more information and examples, see the pip uninstall reference.
Listing Packages¶
To list installed packages:
$ pip list
Pygments (1.5)
docutils (0.9.1)
Sphinx (1.1.2)
Jinja2 (2.6)
To list outdated packages, and show the latest version available:
$ pip list --outdated
docutils (Current: 0.9.1 Latest: 0.10)
Sphinx (Current: 1.1.2 Latest: 1.1.3)
To show details about an installed package:
$ pip show sphinx
---
Name: Sphinx
Version: 1.1.3
Location: /my/env/lib/pythonx.x/site-packages
Requires: Pygments, Jinja2, docutils
For more information and examples, see the pip list and pip show reference pages.
Searching for Packages¶
pip can search PyPI for packages using the pip search
command:
$ pip search "query"
The query will be used to search the names and summaries of all packages.
For more information and examples, see the pip search reference.
Configuration¶
Config file¶
pip allows you to set all command line option defaults in a standard ini style config file.
The names and locations of the configuration files vary slightly across platforms.
- On Unix and Mac OS X the configuration file is:
$HOME/.pip/pip.conf
- On Windows, the configuration file is:
%HOME%\pip\pip.ini
You can set a custom path location for the config file using the environment variable PIP_CONFIG_FILE
.
In a virtual environment, an additional config file will be read from the base
directory of the virtualenv (sys.prefix
as reported by Python). The base
name of the file is the same as the user configuration file (pip.conf
on Unix and OSX, pip.ini
on Windows). Values in the virtualenv-specific
configuration file take precedence over those in the user’s configuration file
(whether from the user home or specified via PIP_CONFIG_FILE
).
The names of the settings are derived from the long command line option, e.g.
if you want to use a different package index (--index-url
) and set the
HTTP timeout (--default-timeout
) to 60 seconds your config file would
look like this:
[global]
timeout = 60
index-url = http://download.zope.org/ppix
Each subcommand can be configured optionally in its own section so that every
global setting with the same name will be overridden; e.g. decreasing the
timeout
to 10
seconds when running the freeze
(Freezing Requirements) command and using
60
seconds for all other commands is possible with:
[global]
timeout = 60
[freeze]
timeout = 10
Boolean options like --ignore-installed
or --no-dependencies
can be
set like this:
[install]
ignore-installed = true
no-dependencies = yes
Appending options like --find-links
can be written on multiple lines:
[global]
find-links =
http://download.example.com
[install]
find-links =
http://mirror1.example.com
http://mirror2.example.com
Environment Variables¶
pip’s command line options can be set with environment variables using the
format PIP_<UPPER_LONG_NAME>
. Dashes (-
) have to be replaced with
underscores (_
).
For example, to set the default timeout:
export PIP_DEFAULT_TIMEOUT=60
This is the same as passing the option to pip directly:
pip --default-timeout=60 [...]
To set options that can be set multiple times on the command line, just add spaces in between values. For example:
export PIP_FIND_LINKS="http://mirror1.example.com http://mirror2.example.com"
is the same as calling:
pip install --find-links=http://mirror1.example.com --find-links=http://mirror2.example.com
Config Precedence¶
Command line options have precedence over environment variables, which have precedence over the config file.
Within the config file, command specific sections have precedence over the global section.
Examples:
--host=foo
overridesPIP_HOST=foo
PIP_HOST=foo
overrides a config file with[global] host = foo
- A command specific section in the config file
[<command>] host = bar
overrides the option with same name in the[global]
config file section
Command Completion¶
pip comes with support for command line completion in bash and zsh.
To setup for bash:
$ pip completion --bash >> ~/.profile
To setup for zsh:
$ pip completion --zsh >> ~/.zprofile
Alternatively, you can use the result of the completion
command
directly with the eval function of you shell, e.g. by adding the following to your startup file:
eval "`pip completion --bash`"
Fast & Local Installs¶
Often, you will want a fast install from local archives, without probing PyPI.
First, download the archives that fulfill your requirements:
$ pip install --download <DIR> -r requirements.txt
Then, install using –find-links and –no-index:
$ pip install --no-index --find-links=[file://]<DIR> -r requirements.txt
Non-recursive upgrades¶
pip install --upgrade
is currently written to perform a recursive upgrade.
E.g. supposing:
- SomePackage-1.0 requires AnotherPackage>=1.0
- SomePackage-2.0 requires AnotherPackage>=1.0 and OneMorePoject==1.0
- SomePackage-1.0 and AnotherPackage-1.0 are currently installed
- SomePackage-2.0 and AnotherPackage-2.0 are the latest versions available on PyPI.
Running pip install --upgrade SomePackage
would upgrade SomePackage and AnotherPackage
despite AnotherPackage already being satisifed.
If you would like to perform a non-recursive upgrade perform these 2 steps:
pip install --upgrade --no-deps SomePackage
pip install SomePackage
The first line will upgrade SomePackage, but not dependencies like AnotherPackage. The 2nd line will fill in new dependencies like OneMorePackage.
User Installs¶
With Python 2.6 came the “user scheme” for installation,
which means that all Python distributions support an alternative install
location that is specific to a user. The default location for each OS is
explained in the python documentation for the site.USER_BASE variable. This mode
of installation can be turned on by specifying the –user option to pip install
.
Moreover, the “user scheme” can be customized by setting the
PYTHONUSERBASE
environment variable, which updates the value of site.USER_BASE
.
To install “SomePackage” into an environment with site.USER_BASE customized to ‘/myappenv’, do the following:
export PYTHONUSERBASE=/myappenv
pip install --user SomePackage
pip install --user
follows four rules:
- When globally installed packages are on the python path, and they conflict with the installation requirements, they are ignored, and not uninstalled.
- When globally installed packages are on the python path, and they satisfy
the installation requirements, pip does nothing, and reports that
requirement is satisfied (similar to how global packages can satisfy
requirements when installing packages in a
--system-site-packages
virtualenv). - pip will not perform a
--user
install in a--no-site-packages
virtualenv (i.e. the default kind of virtualenv), due to the user site not being on the python path. The installation would be pointless. - In a
--system-site-packages
virtualenv, pip will not install a package that conflicts with a package in the virtualenv site-packages. The –user installation would lack sys.path precedence and be pointless.
To make the rules clearer, here are some examples:
From within a --no-site-packages
virtualenv (i.e. the default kind):
$ pip install --user SomePackage
Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
From within a --system-site-packages
virtualenv where SomePackage==0.3
is already installed in the virtualenv:
$ pip install --user SomePackage==0.4
Will not install to the user site because it will lack sys.path precedence
From within a real python, where SomePackage
is not installed globally:
$ pip install --user SomePackage
[...]
Successfully installed SomePackage
From within a real python, where SomePackage
is installed globally, but is not the latest version:
$ pip install --user SomePackage
[...]
Requirement already satisfied (use --upgrade to upgrade)
$ pip install --user --upgrade SomePackage
[...]
Successfully installed SomePackage
From within a real python, where SomePackage
is installed globally, and is the latest version:
$ pip install --user SomePackage
[...]
Requirement already satisfied (use --upgrade to upgrade)
$ pip install --user --upgrade SomePackage
[...]
Requirement already up-to-date: SomePackage
# force the install
$ pip install --user --ignore-installed SomePackage
[...]
Successfully installed SomePackage
Ensuring Repeatability¶
Three things are required to fully guarantee a repeatable installation using requirements files.
- The requirements file was generated by
pip freeze
or you’re sure it only contains requirements that specify a specific version. - The installation is performed using –no-deps. This guarantees that only what is explicitly listed in the requirements file is installed.
- The installation is performed against an index or find-links location that is guaranteed to not allow archives to be changed and updated without a version increase. Unfortunately, this is not true on PyPI. It is possible for the same pypi distribution to have a different hash over time. Project authors are allowed to delete a distribution, and then upload a new one with the same name and version, but a different hash. See Issue #1175 for plans to add hash confirmation to pip, or a new “lock file” notion, but for now, know that the peep project offers this feature on top of pip using requirements file comments.
Reference Guide¶
pip¶
Description¶
Logging¶
Console logging¶
pip offers -v, –verbose and -q, –quiet
to control the console log level. Each option can be used multiple times and
used together. One -v
increases the verbosity by one, whereas one -q
decreases it by
one.
The series of log levels, in order, are as follows:
VERBOSE_DEBUG, DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL
NOTIFY
is the default level.
A few examples on how the parameters work to affect the level:
- specifying nothing results in
NOTIFY
-v
results inINFO
-vv
results inDEBUG
-q
results inWARN
-vq
results inNOTIFY
The most practical use case for users is either -v
or -vv
to see
additional logging to help troubleshoot an issue.
File logging¶
pip offers the –log option for specifying a file where a maximum verbosity log will be kept. This option is empty by default. This log appends to previous logging.
Additionally, when commands fail (i.e. return a non-zero exit code), pip writes a “failure log” for the failed command. This log overwrites previous logging. The default location is as follows:
- On Unix and Mac OS X:
$HOME/.pip/pip.log
- On Windows, the configuration file is:
%HOME%\pip\pip.log
The option for the failure log, is –log-file.
Both logs add a line per execution to specify the date and what pip executable wrote the log.
Like all pip options, --log
and log-file
, can also be set as an environment
variable, or placed into the pip config file. See the Configuration
section.
General Options¶
-
-h
,
--help
¶
Show help.
-
-v
,
--verbose
¶
Give more output. Option is additive, and can be used up to 3 times.
-
-V
,
--version
¶
Show version and exit.
-
-q
,
--quiet
¶
Give less output.
-
--log-file
<path>
¶ Path to a verbose non-appending log, that only logs failures. This log is active by default at <see File logging>.
-
--log
<path>
¶ Path to a verbose appending log. This log is inactive by default.
-
--proxy
<proxy>
¶ Specify a proxy in the form [user:passwd@]proxy.server:port.
-
--timeout
<sec>
¶ Set the socket timeout (default 15 seconds).
-
--exists-action
<action>
¶ Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.
-
--cert
<path>
¶ Path to alternate CA bundle.
pip install¶
Contents
Usage¶
pip install [options] <requirement specifier> ...
pip install [options] -r <requirements file> ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
Description¶
Install packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports installing from “requirements files”, which provide an easy way to specify a whole environment to be installed.
Requirements File Format¶
Each line of the requirements file indicates something to be installed, and like arguments to pip install, the following forms are supported:
<requirement specifier>
<archive url/path>
[-e] <local project path>
[-e] <vcs project url>
See the pip install Examples for examples of all these forms.
A line beginning with #
is treated as a comment and ignored.
Additionally, the following Package Index Options are supported:
For example, to specify –no-index and 2 –find-links locations:
--no-index
--find-links /my/local/archives
--find-links http://some.archives.com/archives
Lastly, if you wish, you can refer to other requirements files, like this:
-r more_requirements.txt
Requirement Specifiers¶
pip supports installing from “requirement specifiers” as implemented in pkg_resources Requirements
Some Examples:
'FooProject >= 1.2' Fizzy [foo, bar] 'PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1' SomethingWhoseVersionIDontCareAbout
Note
Use single or double quotes around specifiers to avoid >
and <
being
interpreted as shell redirects. e.g. pip install 'FooProject>=1.2'
.
Pre-release Versions¶
Starting with v1.4, pip will only install stable versions as specified by PEP426 by default. If a version cannot be parsed as a compliant PEP426 version then it is assumed to be a pre-release.
If a Requirement specifier includes a pre-release or development version
(e.g. >=0.0.dev0
) then pip will allow pre-release and development versions
for that requirement. This does not include the != flag.
The pip install
command also supports a –pre flag
that will enable installing pre-releases and development releases.
Externally Hosted Files¶
Starting with v1.4, pip will warn about installing any file that does not come from the primary index. As of version 1.5, pip defaults to ignoring these files unless asked to consider them.
The pip install
command supports a
–allow-external PROJECT option that will enable
installing links that are linked directly from the simple index but to an
external host that also have a supported hash fragment. Externally hosted
files for all projects may be enabled using the
–allow-all-external flag to the pip install
command.
The pip install
command also supports a
–allow-unverified PROJECT option that will enable
installing insecurely linked files. These are either directly linked (as above)
files without a hash, or files that are linked from either the home page or the
download url of a package.
These options can be used in a requirements file. Assuming some fictional ExternalPackage that is hosted external and unverified, then your requirements file would be like so:
--allow-external ExternalPackage
--allow-unverified ExternalPackage
ExternalPackage
VCS Support¶
pip supports installing from Git, Mercurial, Subversion and Bazaar, and detects the type of VCS using url prefixes: “git+”, “hg+”, “bzr+”, “svn+”.
pip requires a working VCS command on your path: git, hg, svn, or bzr.
VCS projects can be installed in editable mode (using the –editable option) or not.
- For editable installs, the clone location by default is “<venv path>/src/SomeProject” in virtual environments, and “<cwd>/src/SomeProject” for global installs. The –src option can be used to modify this location.
- For non-editable installs, the project is built locally in a temp dir and then installed normally.
The url suffix “egg=<project name>” is used by pip in it’s dependency logic to identify the project prior to pip downloading and analyzing the metadata.
Git¶
pip currently supports cloning over git
, git+https
and git+ssh
:
Here are the supported forms:
[-e] git+git://git.myproject.org/MyProject#egg=MyProject
[-e] git+https://git.myproject.org/MyProject#egg=MyProject
[-e] git+ssh://git.myproject.org/MyProject#egg=MyProject
-e git+git@git.myproject.org:MyProject#egg=MyProject
Passing branch names, a commit hash or a tag name is possible like so:
[-e] git://git.myproject.org/MyProject.git@master#egg=MyProject
[-e] git://git.myproject.org/MyProject.git@v1.0#egg=MyProject
[-e] git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject
Mercurial¶
The supported schemes are: hg+http
, hg+https
,
hg+static-http
and hg+ssh
.
Here are the supported forms:
[-e] hg+http://hg.myproject.org/MyProject#egg=MyProject
[-e] hg+https://hg.myproject.org/MyProject#egg=MyProject
[-e] hg+ssh://hg.myproject.org/MyProject#egg=MyProject
You can also specify a revision number, a revision hash, a tag name or a local branch name like so:
[-e] hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject
[-e] hg+http://hg.myproject.org/MyProject@2019#egg=MyProject
[-e] hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject
[-e] hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject
Subversion¶
pip supports the URL schemes svn
, svn+svn
, svn+http
, svn+https
, svn+ssh
.
You can also give specific revisions to an SVN URL, like so:
[-e] svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject
[-e] svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject
which will check out revision 2019. @{20080101}
would also check
out the revision from 2008-01-01. You can only check out specific
revisions using -e svn+...
.
Bazaar¶
pip supports Bazaar using the bzr+http
, bzr+https
, bzr+ssh
,
bzr+sftp
, bzr+ftp
and bzr+lp
schemes.
Here are the supported forms:
[-e] bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject
[-e] bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject
[-e] bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject
[-e] bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject
[-e] bzr+lp:MyProject#egg=MyProject
Tags or revisions can be installed like so:
[-e] bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject
[-e] bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject
Finding Packages¶
pip searches for packages on PyPI using the http simple interface, which is documented here and there
pip offers a number of Package Index Options for modifying how packages are found.
See the pip install Examples.
SSL Certificate Verification¶
Starting with v1.3, pip provides SSL certificate verification over https, for the purpose of providing secure, certified downloads from PyPI.
Hash Verification¶
PyPI provides md5 hashes in the hash fragment of package download urls.
pip supports checking this, as well as any of the guaranteed hashlib algorithms (sha1, sha224, sha384, sha256, sha512, md5).
The hash fragment is case sensitive (i.e. sha1 not SHA1).
This check is only intended to provide basic download corruption protection. It is not intended to provide security against tampering. For that, see SSL Certificate Verification
Download Cache¶
pip offers a –download-cache option for installs to prevent redundant downloads of archives from PyPI.
The point of this cache is not to circumvent the index crawling process, but to just prevent redundant downloads.
Items are stored in this cache based on the url the archive was found at, not simply the archive name.
If you want a fast/local install solution that circumvents crawling PyPI, see the Fast & Local Installs.
Like all options, –download-cache, can also be set as an environment variable, or placed into the pip config file. See the Configuration section.
“Editable” Installs¶
“Editable” installs are fundamentally “setuptools develop mode” installs.
You can install local projects or VCS projects in “editable” mode:
$ pip install -e path/to/SomeProject
$ pip install -e git+http://repo/my_project.git#egg=SomeProject
For local projects, the “SomeProject.egg-info” directory is created relative to
the project path. This is one advantage over just using setup.py develop
,
which creates the “egg-info” directly relative the current working directory.
Controlling setup_requires¶
Setuptools offers the setup_requires
setup() keyword
for specifying dependencies that need to be present in order for the setup.py
script to run. Internally, Setuptools uses easy_install
to fulfill these
dependencies.
pip has no way to control how these dependencies are located. None of the Package Index Options have an effect.
The solution is to configure a “system” or “personal” Distutils configuration file to manage the fulfillment.
For example, to have the dependency located at an alternate index, add this:
[easy_install]
index_url = https://my.index-mirror.com
To have the dependency located from a local directory and not crawl PyPI, add this:
[easy_install]
allow_hosts = ''
find_links = file:///path/to/local/archives
Options¶
-
-e
,
--editable
<path/url>
¶ Install a project in editable mode (i.e. setuptools “develop mode”) from a local project path or a VCS url.
-
-r
,
--requirement
<file>
¶ Install from the given requirements file. This option can be used multiple times.
-
-b
,
--build
<dir>
¶ Directory to unpack packages into and build in. The default in a virtualenv is “<venv path>/build”. The default for global installs is “<OS temp dir>/pip_build_<username>”.
-
-t
,
--target
<dir>
¶ Install packages into <dir>.
-
-d
,
--download
<dir>
¶ Download packages into <dir> instead of installing them, regardless of what’s already installed.
-
--download-cache
<dir>
¶ Cache downloaded packages in <dir>.
-
--src
<dir>
¶ Directory to check out editable projects into. The default in a virtualenv is “<venv path>/src”. The default for global installs is “<current dir>/src”.
-
-U
,
--upgrade
¶
Upgrade all packages to the newest available version. This process is recursive regardless of whether a dependency is already satisfied.
-
--force-reinstall
¶
When upgrading, reinstall all packages even if they are already up-to-date.
-
-I
,
--ignore-installed
¶
Ignore the installed packages (reinstalling instead).
-
--no-deps
¶
Don’t install package dependencies.
-
--no-install
¶
DEPRECATED. Download and unpack all packages, but don’t actually install them.
-
--no-download
¶
DEPRECATED. Don’t download any packages, just install the ones already downloaded (completes an install run with –no-install).
-
--install-option
<options>
¶ Extra arguments to be supplied to the setup.py install command (use like –install-option=”–install-scripts=/usr/local/bin”). Use multiple –install-option options to pass multiple options to setup.py install. If you are using an option with a directory path, be sure to use absolute path.
-
--global-option
<options>
¶ Extra global options to be supplied to the setup.py call before the install command.
-
--user
¶
Install using the user scheme.
-
--egg
¶
Install packages as eggs, not ‘flat’, like pip normally does. This option is not about installing from eggs. (WARNING: Because this option overrides pip’s normal install logic, requirements files may not behave as expected.)
-
--root
<dir>
¶ Install everything relative to this alternate root directory.
-
--compile
¶
Compile py files to pyc
-
--no-compile
¶
Do not compile py files to pyc
-
--no-use-wheel
¶
Do not Find and prefer wheel archives when searching indexes and find-links locations.
-
--pre
¶
Include pre-release and development versions. By default, pip only finds stable versions.
-
--no-clean
¶
Don’t clean up build directories.
-
-i
,
--index-url
<url>
¶ Base URL of Python Package Index (default https://pypi.python.org/simple/).
-
--extra-index-url
<url>
¶ Extra URLs of package indexes to use in addition to –index-url.
-
--no-index
¶
Ignore package index (only looking at –find-links URLs instead).
-
-f
,
--find-links
<url>
¶ If a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing.
-
--allow-external
<package>
¶ Allow the installation of externally hosted files
-
--allow-all-external
¶
Allow the installation of all externally hosted files
-
--allow-unverified
<package>
¶ Allow the installation of insecure and unverifiable files
-
--process-dependency-links
¶
Enable the processing of dependency links.
Examples¶
- Install SomePackage and it’s dependencies from PyPI using Requirement Specifiers
$ pip install SomePackage # latest version $ pip install SomePackage==1.0.4 # specific version $ pip install 'SomePackage>=1.0.4' # minimum version
- Install a list of requirements specified in a file. See the Requirements files.
$ pip install -r requirements.txt
- Upgrade an already installed SomePackage to the latest from PyPI.
$ pip install --upgrade SomePackage
- Install a local project in “editable” mode. See the section on Editable Installs.
$ pip install -e . # project in current directory $ pip install -e path/to/project # project in another directory
- Install a project from VCS in “editable” mode. See the sections on VCS Support and Editable Installs.
$ pip install -e git+https://git.repo/some_pkg.git#egg=SomePackage # from git $ pip install -e hg+https://hg.repo/some_pkg.git#egg=SomePackage # from mercurial $ pip install -e svn+svn://svn.repo/some_pkg/trunk/#egg=SomePackage # from svn $ pip install -e git+https://git.repo/some_pkg.git@feature#egg=SomePackage # from 'feature' branch $ pip install -e git+https://git.repo/some_repo.git@egg=subdir&subdirectory=subdir_path # install a python package from a repo subdirectory
- Install a package with setuptools extras.
$ pip install SomePackage[PDF] $ pip install SomePackage[PDF]==3.0 $ pip install -e .[PDF]==3.0 # editable project in current directory
- Install a particular source archive file.
$ pip install ./downloads/SomePackage-1.0.4.tar.gz $ pip install http://my.package.repo/SomePackage-1.0.4.zip
- Install from alternative package repositories.
Install from a different index, and not PyPI
$ pip install --index-url http://my.package.repo/simple/ SomePackageSearch an additional index during install, in addition to PyPI
$ pip install --extra-index-url http://my.package.repo/simple SomePackageInstall from a local flat directory containing archives (and don’t scan indexes):
$ pip install --no-index --find-links=file:///local/dir/ SomePackage $ pip install --no-index --find-links=/local/dir/ SomePackage $ pip install --no-index --find-links=relative/dir/ SomePackage
- Find pre-release and development versions, in addition to stable versions. By default, pip only finds stable versions.
$ pip install --pre SomePackage
pip uninstall¶
Contents
Description¶
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutils packages installed with
python setup.py install
, which leave behind no metadata to determine what files were installed. - Script wrappers installed by
python setup.py develop
.
pip freeze¶
Contents
Description¶
Output installed packages in requirements format.
Options¶
-
-r
,
--requirement
<file>
¶ Use the order in the given requirements file and it’s comments when generating output.
-
-f
,
--find-links
<url>
¶ URL for finding packages, which will be added to the output.
-
-l
,
--local
¶
If in a virtualenv that has global access, do not output globally-installed packages.
pip list¶
Contents
Description¶
List installed packages, including editables.
Options¶
-
-o
,
--outdated
¶
List outdated packages (excluding editables)
-
-u
,
--uptodate
¶
List uptodate packages (excluding editables)
-
-e
,
--editable
¶
List editable projects.
-
-l
,
--local
¶
If in a virtualenv that has global access, do not list globally-installed packages.
-
--pre
¶
Include pre-release and development versions. By default, pip only finds stable versions.
-
-i
,
--index-url
<url>
¶ Base URL of Python Package Index (default https://pypi.python.org/simple/).
-
--extra-index-url
<url>
¶ Extra URLs of package indexes to use in addition to –index-url.
-
--no-index
¶
Ignore package index (only looking at –find-links URLs instead).
-
-f
,
--find-links
<url>
¶ If a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing.
-
--allow-external
<package>
¶ Allow the installation of externally hosted files
-
--allow-all-external
¶
Allow the installation of all externally hosted files
-
--allow-unverified
<package>
¶ Allow the installation of insecure and unverifiable files
-
--process-dependency-links
¶
Enable the processing of dependency links.
pip wheel¶
Contents
Usage¶
pip wheel [options] <requirement specifier> ...
pip wheel [options] -r <requirements file> ...
pip wheel [options] <vcs project url> ...
pip wheel [options] <local project path> ...
pip wheel [options] <archive url/path> ...
Description¶
Build Wheel archives for your requirements and dependencies.
Wheel is a built-package format, and offers the advantage of not recompiling your software during every install. For more details, see the wheel docs: http://wheel.readthedocs.org/en/latest.
Requirements: setuptools>=0.8, and wheel.
‘pip wheel’ uses the bdist_wheel setuptools extension from the wheel package to build individual wheels.
Options¶
-
-w
,
--wheel-dir
<dir>
¶ Build wheels into <dir>, where the default is ‘<cwd>/wheelhouse’.
-
--no-use-wheel
¶
Do not Find and prefer wheel archives when searching indexes and find-links locations.
-
--build-option
<options>
¶ Extra arguments to be supplied to ‘setup.py bdist_wheel’.
-
-r
,
--requirement
<file>
¶ Install from the given requirements file. This option can be used multiple times.
-
--download-cache
<dir>
¶ Cache downloaded packages in <dir>.
-
--no-deps
¶
Don’t install package dependencies.
-
-b
,
--build
<dir>
¶ Directory to unpack packages into and build in. The default in a virtualenv is “<venv path>/build”. The default for global installs is “<OS temp dir>/pip_build_<username>”.
-
--global-option
<options>
¶ Extra global options to be supplied to the setup.py call before the ‘bdist_wheel’ command.
-
--pre
¶
Include pre-release and development versions. By default, pip only finds stable versions.
-
--no-clean
¶
Don’t clean up build directories.
-
-i
,
--index-url
<url>
¶ Base URL of Python Package Index (default https://pypi.python.org/simple/).
-
--extra-index-url
<url>
¶ Extra URLs of package indexes to use in addition to –index-url.
-
--no-index
¶
Ignore package index (only looking at –find-links URLs instead).
-
-f
,
--find-links
<url>
¶ If a url or path to an html file, then parse for links to archives. If a local path or file:// url that’s a directory, then look for archives in the directory listing.
-
--allow-external
<package>
¶ Allow the installation of externally hosted files
-
--allow-all-external
¶
Allow the installation of all externally hosted files
-
--allow-unverified
<package>
¶ Allow the installation of insecure and unverifiable files
-
--process-dependency-links
¶
Enable the processing of dependency links.
Development¶
Pull Requests¶
Submit Pull Requests against the develop branch.
Provide a good description of what you’re doing and why.
Provide tests that cover your changes and try to run the tests locally first.
Automated Testing¶
All pull requests and merges to ‘develop’ branch are tested in Travis based on our .travis.yml file.
Usually, a link to your specific travis build appears in pull requests, but if not, you can find it on our travis pull requests page
The only way to trigger Travis to run again for a pull request, is to submit another change to the pull branch.
We also have Jenkins CI that runs regularly for certain python versions on windows and centos.
Running tests¶
OS Requirements: subversion, bazaar, git, and mercurial.
Python Requirements: tox or pytest, virtualenv, scripttest, and mock
Ways to run the tests locally:
$ tox -e py33 # The preferred way to run the tests, can use pyNN to
# run for a particular version or leave off the -e to
# run for all versions.
$ python setup.py test # Using the setuptools test plugin
$ py.test # Using py.test directly
$ tox # Using tox against pip's tox.ini
Getting Involved¶
The pip project welcomes help in the following ways:
- Making Pull Requests for code, tests, or docs.
- Commenting on open issues and pull requests.
- Helping to answer questions on the mailing list.
If you want to become an official maintainer, start by helping out.
Later, when you think you’re ready, get in touch with one of the maintainers, and they will initiate a vote.
Release Process¶
This process includes virtualenv, since pip releases necessitate a virtualenv release.
As an example, the instructions assume we’re releasing pip-1.4, and virtualenv-1.10.
- Upgrade setuptools, if needed:
- Upgrade setuptools in
virtualenv/develop
using the Refresh virtualenv process.- Create a pull request against
pip/develop
with a modified.travis.yml
file that installs virtualenv fromvirtualenv/develop
, to confirm the travis builds are still passing.
- Create Release branches:
- Create
pip/release-1.4
branch.- In
pip/develop
, changepip.version
to ‘1.5.dev1’.- Create
virtualenv/release-1.10
branch.- In
virtualenv/develop
, changevirtualenv.version
to ‘1.11.dev1’.
- Prepare “rcX”:
- In
pip/release-1.4
, changepip.version
to ‘1.4rcX’, and tag with ‘1.4rcX’.- Build a pip sdist from
pip/release-1.4
, and build it intovirtualenv/release-1.10
using the Refresh virtualenv process.- In
virtualenv/release-1.10
, changevirtualenv.version
to ‘1.10rcX’, and tag with ‘1.10rcX’.
- Announce
pip-1.4rcX
andvirtualenv-1.10rcX
with the RC Install Instructions and elicit feedback. - Apply fixes to ‘rcX’:
- Apply fixes to
pip/release-1.4
andvirtualenv/release-1.10
- Periodically merge fixes to
pip/develop
andvirtualenv/develop
- Repeat #4 thru #6 if needed.
- Final Release:
- In
pip/release-1.4
, changepip.version
to ‘1.4’, and tag with ‘1.4’.- Merge
pip/release-1.4
topip/master
.- Build a pip sdist from
pip/release-1.4
, and load it intovirtualenv/release-1.10
using the Refresh virtualenv process.- Merge
vitualenv/release-1.10
tovirtualenv/develop
.- In
virtualenv/release-1.10
, changevirtualenv.version
to ‘1.10’, and tag with ‘1.10’.- Merge
virtualenv/release-1.10
tovirtualenv/master
- Build and upload pip and virtualenv sdists to PyPI.
Refresh virtualenv¶
- Update the embedded versions of pip and setuptools in
virtualenv_support
. - Run
bin/rebuild-script.py
to rebuild virtualenv based on the latest versions.
RC Install Instructions¶
$ curl -L -O https://github.com/pypa/virtualenv/archive/1.10rc1.tar.gz
$ echo "<md5sum value> 1.10rc1.tar.gz" | md5sum -c
1.10rc1.tar.gz: OK
$ tar zxf 1.10rc1.tar.gz
$ python virtualenv-1.10rc1/virtualenv.py myVE
$ myVE/bin/pip install SomePackage
Release Notes¶
1.5.2 (2014-01-26)
- Upgraded the vendored
pkg_resources
and_markerlib
to setuptools 2.1. - Fixed an error that prevented accessing PyPI when pyopenssl, ndg-httpsclient, and pyasn1 are installed
- Fixed an issue that caused trailing comments to be incorrectly included as part of the URL in a requirements file
1.5.1 (2014-01-20)
- pip now only requires setuptools (any setuptools, not a certain version) when installing distributions from src (i.e. not from wheel). (Pull #1434).
- get-pip.py now installs setuptools, when it’s not already installed (Pull #1475)
- Don’t decode downloaded files that have a
Content-Encoding
header. (Pull #1435) - Fix to correctly parse wheel filenames with single digit versions. (Pull #1445)
- If –allow-unverified is used assume it also means –allow-external. (Pull #1457)
1.5 (2014-01-01)
- BACKWARD INCOMPATIBLE pip no longer supports the
--use-mirrors
,-M
, and--mirrors
flags. The mirroring support has been removed. In order to use a mirror specify it as the primary index with-i
or--index-url
, or as an additional index with--extra-index-url
. (Pull #1098, CVE-2013-5123) - BACKWARD INCOMPATIBLE pip no longer will scrape insecure external urls by
default nor will it install externally hosted files by default. Users may opt
into installing externally hosted or insecure files or urls using
--allow-external PROJECT
and--allow-unverified PROJECT
. (Pull #1055) - BACKWARD INCOMPATIBLE pip no longer respects dependency links by default.
Users may opt into respecting them again using
--process-dependency-links
. - DEPRECATION
pip install --no-install
andpip install --no-download
are now formally deprecated. See Issue #906 for discussion on possible alternatives, or lack thereof, in future releases. - DEPRECATION
pip zip
andpip unzip
are now formally deprecated. - pip will now install Mac OSX platform wheels from PyPI. (Pull #1278)
- pip now generates the appropriate platform-specific console scripts when installing wheels. (Pull #1251)
- Pip now confirms a wheel is supported when installing directly from a path or url. (Pull #1315)
- Fixed #1097,
--ignore-installed
now behaves again as designed, after it was unintentionally broke in v0.8.3 when fixing Issue #14 (Pull #1352). - Fixed a bug where global scripts were being removed when uninstalling –user installed packages (Pull #1353).
- Fixed #1163, –user wasn’t being respected when installing scripts from wheels (Pull #1176).
- Fixed #1150, we now assume ‘_’ means ‘-‘ in versions from wheel filenames (Pull #1158).
- Fixed #219, error when using –log with a failed install (Pull #1205).
- Fixed #1131, logging was buffered and choppy in Python 3.
- Fixed #70, –timeout was being ignored (Pull #1202).
- Fixed #772, error when setting PIP_EXISTS_ACTION (Pull #1201).
- Added colors to the logging output in order to draw attention to important warnings and errors. (Pull #1109)
- Added warnings when using an insecure index, find-link, or dependency link. (Pull #1121)
- Added support for installing packages from a subdirectory using the
subdirectory
editable option. ( Pull #1082 ) - Fixed #1192. “TypeError: bad operand type for unary” in some cases when installing wheels using –find-links (Pull #1218).
- Fixed #1133 and #317. Archive contents are now written based on system defaults and umask (i.e. permissions are not preserved), except that regular files with any execute permissions have the equivalent of “chmod +x” applied after being written (Pull #1146).
- PreviousBuildDirError now returns a non-zero exit code and prevents the previous build dir from being cleaned in all cases (Pull #1162).
- Renamed –allow-insecure to –allow-unverified, however the old name will continue to work for a period of time (Pull #1257).
- Fixed #1006, error when installing local projects with symlinks in Python 3. (Pull #1311)
- The previously hidden
--log-file
otion, is now shown as a general option. (Pull #1316)
1.4.1 (2013-08-07)
- New Signing Key Release 1.4.1 is using a different key than normal with fingerprint: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
- Fixed issues with installing from pybundle files (Pull #1116).
- Fixed error when sysconfig module throws an exception (Pull #1095).
- Don’t ignore already installed pre-releases (Pull #1076).
- Fixes related to upgrading setuptools (Pull #1092).
- Fixes so that –download works with wheel archives (Pull #1113).
- Fixes related to recognizing and cleaning global build dirs (Pull #1080).
1.4 (2013-07-23)
- BACKWARD INCOMPATIBLE pip now only installs stable versions by default,
and offers a new
--pre
option to also find pre-release and development versions. (Pull #834) - BACKWARD INCOMPATIBLE Dropped support for Python 2.5. The minimum supported Python version for pip 1.4 is Python 2.6.
- Added support for installing and building wheel archives. Thanks Daniel Holth, Marcus Smith, Paul Moore, and Michele Lacchia (Pull #845)
- Applied security patch to pip’s ssl support related to certificate DNS wildcard matching (http://bugs.python.org/issue17980).
- To satisfy pip’s setuptools requirement, pip now recommends setuptools>=0.8, not distribute. setuptools and distribute are now merged into one project called ‘setuptools’. (Pull #1003)
- pip will now warn when installing a file that is either hosted externally to the index or cannot be verified with a hash. In the future pip will default to not installing them and will require the flags –allow-external NAME, and –allow-insecure NAME respectively. (Pull #985)
- If an already-downloaded or cached file has a bad hash, re-download it rather than erroring out. (Issue #963).
pip bundle
and support for installing from pybundle files is now considered deprecated and will be removed in pip v1.5.- Fixed a number of issues (#413, #709, #634, #602, and #939) related to cleaning up and not reusing build directories. (Pull #865, #948)
- Added a User Agent so that pip is identifiable in logs. (Pull #901)
- Added ssl and –user support to get-pip.py. Thanks Gabriel de Perthuis. (Pull #895)
- Fixed the proxy support, which was broken in pip 1.3.x (Pull #840)
- Fixed issue #32 - pip fails when server does not send content-type header. Thanks Hugo Lopes Tavares and Kelsey Hightower (Pull #872).
- “Vendorized” distlib as pip.vendor.distlib (https://distlib.readthedocs.org/).
- Fixed git VCS backend with git 1.8.3. (Pull #967)
1.3.1 (2013-03-08)
- Fixed a major backward incompatible change of parsing URLs to externally hosted packages that got accidentily included in 1.3.
1.3 (2013-03-07)
- SSL Cert Verification; Make https the default for PyPI access. Thanks James Cleveland, Giovanni Bajo, Marcus Smith and many others (Pull #791, CVE-2013-1629).
- Added “pip list” for listing installed packages and the latest version available. Thanks Rafael Caricio, Miguel Araujo, Dmitry Gladkov (Pull #752)
- Fixed security issues with pip’s use of temp build directories. Thanks David (d1b) and Thomas Guttler. (Pull #780, CVE-2013-1888)
- Improvements to sphinx docs and cli help. (Pull #773)
- Fixed issue #707, dealing with OS X temp dir handling, which was causing global NumPy installs to fail. (Pull #768)
- Split help output into general vs command-specific option groups. Thanks Georgi Valkov. (Pull #744; Pull #721 contains preceding refactor)
- Fixed dependency resolution when installing from archives with uppercase project names. (Pull #724)
- Fixed problem where re-installs always occurred when using file:// find-links. (Pulls #683/#702)
- “pip install -v” now shows the full download url, not just the archive name. Thanks Marc Abramowitz (Pull #687)
- Fix to prevent unnecessary PyPI redirects. Thanks Alex Gronholm (Pull #695)
- Fixed issue #670 - install failure under Python 3 when the same version of a package is found under 2 different URLs. Thanks Paul Moore (Pull #671)
- Fix git submodule recursive updates. Thanks Roey Berman. (Pulls #674)
- Explicitly ignore rel=’download’ links while looking for html pages. Thanks Maxime R. (Pull #677)
- –user/–upgrade install options now work together. Thanks ‘eevee’ for discovering the problem. (Pull #705)
- Added check in
install --download
to prevent re-downloading if the target file already exists. Thanks Andrey Bulgakov. (Pull #669) - Added support for bare paths (including relative paths) as argument to –find-links. Thanks Paul Moore for draft patch.
- Added support for –no-index in requirements files.
- Added “pip show” command to get information about an installed package. Fixes #131. Thanks Kelsey Hightower and Rafael Caricio.
- Added –root option for “pip install” to specify root directory. Behaves like the same option in distutils but also plays nice with pip’s egg-info. Thanks Przemek Wrzos. (Issue #253 / Pull #693)
1.2.1 (2012-09-06)
- Fixed a regression introduced in 1.2 about raising an exception when not finding any files to uninstall in the current environment. Thanks for the fix, Marcus Smith.
1.2 (2012-09-01)
- Dropped support for Python 2.4 The minimum supported Python version is now Python 2.5.
- Fixed issue #605 - pypi mirror support broken on some DNS responses. Thanks philwhin.
- Fixed issue #355 - pip uninstall removes files it didn’t install. Thanks pjdelport.
- Fixed issues #493, #494, #440, and #573 related to improving support for the user installation scheme. Thanks Marcus Smith.
- Write failure log to temp file if default location is not writable. Thanks andreigc.
- Pull in submodules for git editable checkouts. Fixes #289 and #421. Thanks Hsiaoming Yang and Markus Hametner.
- Use a temporary directory as the default build location outside of a virtualenv. Fixes issues #339 and #381. Thanks Ben Rosser.
- Added support for specifying extras with local editables. Thanks Nick Stenning.
- Added
--egg
flag to request egg-style rather than flat installation. Refs issue #3. Thanks Kamal Bin Mustafa. - Fixed issue #510 - prevent e.g.
gmpy2-2.0.tar.gz
from matching a request topip install gmpy
; sdist filename must begin with full project name followed by a dash. Thanks casevh for the report. - Fixed issue #504 - allow package URLS to have querystrings. Thanks W. Trevor King.
- Fixed issue #58 - pip freeze now falls back to non-editable format rather than blowing up if it can’t determine the origin repository of an editable. Thanks Rory McCann.
- Added a __main__.py file to enable python -m pip on Python versions that support it. Thanks Alexey Luchko.
- Fixed issue #487 - upgrade from VCS url of project that does exist on index. Thanks Andrew Knapp for the report.
- Fixed issue #486 - fix upgrade from VCS url of project with no distribution on index. Thanks Andrew Knapp for the report.
- Fixed issue #427 - clearer error message on a malformed VCS url. Thanks Thomas Fenzl.
- Added support for using any of the built in guaranteed algorithms in
hashlib
as a checksum hash. - Fixed issue #321 - Raise an exception if current working directory can’t be found or accessed.
- Fixed issue #82 - Removed special casing of the user directory and use the Python default instead.
- Fixed #436 - Only warn about version conflicts if there is actually one.
This re-enables using
==dev
in requirements files. - Moved tests to be run on Travis CI: http://travis-ci.org/pypa/pip
- Added a better help formatter.
1.1 (2012-02-16)
- Fixed issue #326 - don’t crash when a package’s setup.py emits UTF-8 and then fails. Thanks Marc Abramowitz.
- Added
--target
option for installing directly to arbitrary directory. Thanks Stavros Korokithakis. - Added support for authentication with Subversion repositories. Thanks Qiangning Hong.
- Fixed issue #315 -
--download
now downloads dependencies as well. Thanks Qiangning Hong. - Errors from subprocesses will display the current working directory. Thanks Antti Kaihola.
- Fixed issue #369 - compatibility with Subversion 1.7. Thanks Qiangning Hong. Note that setuptools remains incompatible with Subversion 1.7; to get the benefits of pip’s support you must use Distribute rather than setuptools.
- Fixed issue #57 - ignore py2app-generated OS X mpkg zip files in finder. Thanks Rene Dudfield.
- Fixed issue #182 - log to ~/Library/Logs/ by default on OS X framework installs. Thanks Dan Callahan for report and patch.
- Fixed issue #310 - understand version tags without minor version (“py3”) in sdist filenames. Thanks Stuart Andrews for report and Olivier Girardot for patch.
- Fixed issue #7 - Pip now supports optionally installing setuptools “extras” dependencies; e.g. “pip install Paste[openid]”. Thanks Matt Maker and Olivier Girardot.
- Fixed issue #391 - freeze no longer borks on requirements files with –index-url or –find-links. Thanks Herbert Pfennig.
- Fixed issue #288 - handle symlinks properly. Thanks lebedov for the patch.
- Fixed issue #49 - pip install -U no longer reinstalls the same versions of packages. Thanks iguananaut for the pull request.
- Removed
-E
/--environment
option andPIP_RESPECT_VIRTUALENV
; both use a restart-in-venv mechanism that’s broken, and neither one is useful since every virtualenv now has pip inside it. Replacepip -E path/to/venv install Foo
withvirtualenv path/to/venv && path/to/venv/pip install Foo
. - Fixed issue #366 - pip throws IndexError when it calls scraped_rel_links
- Fixed issue #22 - pip search should set and return a userful shell status code
- Fixed issue #351 and #365 - added global
--exists-action
command line option to easier script file exists conflicts, e.g. from editable requirements from VCS that have a changed repo URL.
1.0.2 (2011-07-16)
- Fixed docs issues.
- Fixed issue #295 - Reinstall a package when using the
install -I
option - Fixed issue #283 - Finds a Git tag pointing to same commit as origin/master
- Fixed issue #279 - Use absolute path for path to docs in setup.py
- Fixed issue #314 - Correctly handle exceptions on Python3.
- Fixed issue #320 - Correctly parse
--editable
lines in requirements files
1.0.1 (2011-04-30)
- Start to use git-flow.
- Fixed issue #274 - find_command should not raise AttributeError
- Fixed issue #273 - respect Content-Disposition header. Thanks Bradley Ayers.
- Fixed issue #233 - pathext handling on Windows.
- Fixed issue #252 - svn+svn protocol.
- Fixed issue #44 - multiple CLI searches.
- Fixed issue #266 - current working directory when running setup.py clean.
1.0 (2011-04-04)
Added Python 3 support! Huge thanks to Vinay Sajip, Vitaly Babiy, Kelsey Hightower, and Alex Gronholm, among others.
Download progress only shown on a real TTY. Thanks Alex Morega.
Fixed finding of VCS binaries to not be fooled by same-named directories. Thanks Alex Morega.
Fixed uninstall of packages from system Python for users of Debian/Ubuntu python-setuptools package (workaround until fixed in Debian and Ubuntu).
Added get-pip.py installer. Simply download and execute it, using the Python interpreter of your choice:
$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py $ python get-pip.py
This may have to be run as root.
Note
Make sure you have distribute installed before using the installer!
0.8.3
- Moved main repository to Github: https://github.com/pypa/pip
- Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer, Brian Rosner
- Fixed issue #14 - No uninstall-on-upgrade with URL package. Thanks Oliver Tonnhofer
- Fixed issue #163 - Egg name not properly resolved. Thanks Igor Sobreira
- Fixed issue #178 - Non-alphabetical installation of requirements. Thanks Igor Sobreira
- Fixed issue #199 - Documentation mentions –index instead of –index-url. Thanks Kelsey Hightower
- Fixed issue #204 - rmtree undefined in mercurial.py. Thanks Kelsey Hightower
- Fixed bug in Git vcs backend that would break during reinstallation.
- Fixed bug in Mercurial vcs backend related to pip freeze and branch/tag resolution.
- Fixed bug in version string parsing related to the suffix “-dev”.
0.8.2
Avoid redundant unpacking of bundles (from pwaller)
Fixed issue #32, #150, #161 - Fixed checking out the correct tag/branch/commit when updating an editable Git requirement.
Fixed issue #49 - Added ability to install version control requirements without making them editable, e.g.:
pip install git+https://github.com/pypa/pip/
Fixed issue #175 - Correctly locate build and source directory on Mac OS X.
Added
git+https://
scheme to Git VCS backend.
0.8.1
- Added global –user flag as shortcut for –install-option=”–user”. From Ronny Pfannschmidt.
- Added support for PyPI mirrors as defined in PEP 381, from Jannis Leidel.
- Fixed issue #138 - Git revisions ignored. Thanks John-Scott Atlakson.
- Fixed issue #95 - Initial editable install of github package from a tag fails. Thanks John-Scott Atlakson.
- Fixed issue #107 - Can’t install if a directory in cwd has the same name as the package you’re installing.
- Fixed issue #39 - –install-option=”–prefix=~/.local” ignored with -e. Thanks Ronny Pfannschmidt and Wil Tan.
0.8
- Track which
build/
directories pip creates, never remove directories it doesn’t create. From Hugo Lopes Tavares. - Pip now accepts file:// index URLs. Thanks Dave Abrahams.
- Various cleanup to make test-running more consistent and less fragile. Thanks Dave Abrahams.
- Real Windows support (with passing tests). Thanks Dave Abrahams.
pip-2.7
etc. scripts are created (Python-version specific scripts)contrib/build-standalone
script creates a runnable.zip
form of pip, from Jannis Leidel- Editable git repos are updated when reinstalled
- Fix problem with
--editable
when multiple.egg-info/
directories are found. - A number of VCS-related fixes for
pip freeze
, from Hugo Lopes Tavares. - Significant test framework changes, from Hugo Lopes Tavares.
0.7.2
- Set zip_safe=False to avoid problems some people are encountering where pip is installed as a zip file.
0.7.1
- Fixed opening of logfile with no directory name. Thanks Alexandre Conrad.
- Temporary files are consistently cleaned up, especially after installing bundles, also from Alex Conrad.
- Tests now require at least ScriptTest 1.0.3.
0.7
- Fixed uninstallation on Windows
- Added
pip search
command. - Tab-complete names of installed distributions for
pip uninstall
. - Support tab-completion when there is a global-option before the subcommand.
- Install header files in standard (scheme-default) location when installing outside a virtualenv. Install them to a slightly more consistent non-standard location inside a virtualenv (since the standard location is a non-writable symlink to the global location).
- pip now logs to a central location by default (instead of creating
pip-log.txt
all over the place) and constantly overwrites the file in question. On Unix and Mac OS X this is'$HOME/.pip/pip.log'
and on Windows it’s'%HOME%\\pip\\pip.log'
. You are still able to override this location with the$PIP_LOG_FILE
environment variable. For a complete (appended) logfile use the separate'--log'
command line option. - Fixed an issue with Git that left an editable packge as a checkout of a remote branch, even if the default behaviour would have been fine, too.
- Fixed installing from a Git tag with older versions of Git.
- Expand “~” in logfile and download cache paths.
- Speed up installing from Mercurial repositories by cloning without updating the working copy multiple times.
- Fixed installing directly from directories (e.g.
pip install path/to/dir/
). - Fixed installing editable packages with
svn+ssh
URLs. - Don’t print unwanted debug information when running the freeze command.
- Create log file directory automatically. Thanks Alexandre Conrad.
- Make test suite easier to run successfully. Thanks Dave Abrahams.
- Fixed “pip install .” and “pip install ..”; better error for directory without setup.py. Thanks Alexandre Conrad.
- Support Debian/Ubuntu “dist-packages” in zip command. Thanks duckx.
- Fix relative –src folder. Thanks Simon Cross.
- Handle missing VCS with an error message. Thanks Alexandre Conrad.
- Added –no-download option to install; pairs with –no-install to separate download and installation into two steps. Thanks Simon Cross.
- Fix uninstalling from requirements file containing -f, -i, or –extra-index-url.
- Leftover build directories are now removed. Thanks Alexandre Conrad.
0.6.3
- Fixed import error on Windows with regard to the backwards compatibility package
0.6.2
- Fixed uninstall when /tmp is on a different filesystem.
- Fixed uninstallation of distributions with namespace packages.
0.6.1
- Added support for the
https
andhttp-static
schemes to the Mercurial andftp
scheme to the Bazaar backend. - Fixed uninstallation of scripts installed with easy_install.
- Fixed an issue in the package finder that could result in an infinite loop while looking for links.
- Fixed issue with
pip bundle
and local files (which weren’t being copied into the bundle), from Whit Morriss.
0.6
- Add
pip uninstall
and uninstall-before upgrade (from Carl Meyer). - Extended configurability with config files and environment variables.
- Allow packages to be upgraded, e.g.,
pip install Package==0.1
thenpip install Package==0.2
. - Allow installing/upgrading to Package==dev (fix “Source version does not match target version” errors).
- Added command and option completion for bash and zsh.
- Extended integration with virtualenv by providing an option to automatically use an active virtualenv and an option to warn if no active virtualenv is found.
- Fixed a bug with pip install –download and editable packages, where directories were being set with 0000 permissions, now defaults to 755.
- Fixed uninstallation of easy_installed console_scripts.
- Fixed uninstallation on Mac OS X Framework layout installs
- Fixed bug preventing uninstall of editables with source outside venv.
- Creates download cache directory if not existing.
0.5.1
- Fixed a couple little bugs, with git and with extensions.
0.5
- Added ability to override the default log file name (
pip-log.txt
) with the environmental variable$PIP_LOG_FILE
. - Made the freeze command print installed packages to stdout instead of
writing them to a file. Use simple redirection (e.g.
pip freeze > stable-req.txt
) to get a file with requirements. - Fixed problem with freezing editable packages from a Git repository.
- Added support for base URLs using
<base href='...'>
when parsing HTML pages. - Fixed installing of non-editable packages from version control systems.
- Fixed issue with Bazaar’s bzr+ssh scheme.
- Added –download-dir option to the install command to retrieve package archives. If given an editable package it will create an archive of it.
- Added ability to pass local file and directory paths to
--find-links
, e.g.--find-links=file:///path/to/my/private/archive
- Reduced the amount of console log messages when fetching a page to find a distribution was problematic. The full messages can be found in pip-log.txt.
- Added
--no-deps
option to install ignore package dependencies - Added
--no-index
option to ignore the package index (PyPI) temporarily - Fixed installing editable packages from Git branches.
- Fixes freezing of editable packages from Mercurial repositories.
- Fixed handling read-only attributes of build files, e.g. of Subversion and Bazaar on Windows.
- When downloading a file from a redirect, use the redirected location’s extension to guess the compression (happens specifically when redirecting to a bitbucket.org tip.gz file).
- Editable freeze URLs now always use revision hash/id rather than tip or branch names which could move.
- Fixed comparison of repo URLs so incidental differences such as presence/absence of final slashes or quoted/unquoted special characters don’t trigger “ignore/switch/wipe/backup” choice.
- Fixed handling of attempt to checkout editable install to a non-empty, non-repo directory.
0.4
- Make
-e
work better with local hg repositories - Construct PyPI URLs the exact way easy_install constructs URLs (you might notice this if you use a custom index that is slash-sensitive).
- Improvements on Windows (from Ionel Maries Cristian).
- Fixed problem with not being able to install private git repositories.
- Make
pip zip
zip all its arguments, not just the first. - Fix some filename issues on Windows.
- Allow the
-i
and--extra-index-url
options in requirements files. - Fix the way bundle components are unpacked and moved around, to make bundles work.
- Adds
-s
option to allow the access to the global site-packages if a virtualenv is to be created. - Fixed support for Subversion 1.6.
0.3.1
- Improved virtualenv restart and various path/cleanup problems on win32.
- Fixed a regression with installing from svn repositories (when not
using
-e
). - Fixes when installing editable packages that put their source in a
subdirectory (like
src/
). - Improve
pip -h
0.3
- Added support for editable packages created from Git, Mercurial and Bazaar repositories and ability to freeze them. Refactored support for version control systems.
- Do not use
sys.exit()
from inside the code, instead use a return. This will make it easier to invoke programmatically. - Put the install record in
Package.egg-info/installed-files.txt
(previously they went insite-packages/install-record-Package.txt
). - Fix a problem with
pip freeze
not including-e svn+
when an svn structure is peculiar. - Allow
pip -E
to work with a virtualenv that uses a different version of Python than the parent environment. - Fixed Win32 virtualenv (
-E
) option. - Search the links passed in with
-f
for packages. - Detect zip files, even when the file doesn’t have a
.zip
extension and it is served with the wrong Content-Type. - Installing editable from existing source now works, like
pip install -e some/path/
will install the package insome/path/
. Most importantly, anything that package requires will also be installed by pip. - Add a
--path
option topip un/zip
, so you can avoid zipping files that are outside of where you expect. - Add
--simulate
option topip zip
.
0.2.1
- Fixed small problem that prevented using
pip.py
without actually installing pip. - Fixed
--upgrade
, which would download and appear to install upgraded packages, but actually just reinstall the existing package. - Fixed Windows problem with putting the install record in the right
place, and generating the
pip
script with Setuptools. - Download links that include embedded spaces or other unsafe characters (those characters get %-encoded).
- Fixed use of URLs in requirement files, and problems with some blank lines.
- Turn some tar file errors into warnings.
0.2
- Renamed to
pip
, and to install you now dopip install PACKAGE
- Added command
pip zip PACKAGE
andpip unzip PACKAGE
. This is particularly intended for Google App Engine to manage libraries to stay under the 1000-file limit. - Some fixes to bundles, especially editable packages and when
creating a bundle using unnamed packages (like just an svn
repository without
#egg=Package
).
0.1.4
- Added an option
--install-option
to pass options to pass arguments tosetup.py install
.svn/
directories are no longer included in bundles, as these directories are specific to a version of svn – if you build a bundle on a system with svn 1.5, you can’t use the checkout on a system with svn 1.4. Instead a filesvn-checkout.txt
is included that notes the original location and revision, and the command you can use to turn it back into an svn checkout. (Probably unpacking the bundle should, maybe optionally, recreate this information – but that is not currently implemented, and it would require network access.)- Avoid ambiguities over project name case, where for instance
MyPackage and mypackage would be considered different packages.
This in particular caused problems on Macs, where
MyPackage/
andmypackage/
are the same directory. - Added support for an environmental variable
$PIP_DOWNLOAD_CACHE
which will cache package downloads, so future installations won’t require large downloads. Network access is still required, but just some downloads will be avoided when using this.
0.1.3
- Always use
svn checkout
(notexport
) so thattag_svn_revision
settings give the revision of the package. - Don’t update checkouts that came from
.pybundle
files.
0.1.2
- Improve error text when there are errors fetching HTML pages when seeking packages.
- Improve bundles: include empty directories, make them work with editable packages.
- If you use
-E env
and the environmentenv/
doesn’t exist, a new virtual environment will be created. - Fix
dependency_links
for finding packages.
0.1.1
- Fixed a NameError exception when running pip outside of a virtualenv environment.
- Added HTTP proxy support (from Prabhu Ramachandran)
- Fixed use of
hashlib.md5
on python2.5+ (also from Prabhu Ramachandran)
0.1
- Initial release