Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

pip (package manager)

From Wikipedia, the free encyclopedia
Package management system for Python
icon
This articlerelies excessively onreferences toprimary sources. Please improve this article by addingsecondary or tertiary sources.
Find sources: "Pip" package manager – news ·newspapers ·books ·scholar ·JSTOR
(November 2022) (Learn how and when to remove this message)

pip
An output ofpip --help
Original authorIan Bicking
Initial release28 October 2008 (17 years ago) (2008-10-28)[1]
Stable release
25.3[2] Edit this on Wikidata / 25 October 2025; 3 months ago (25 October 2025)
Written inPython
Operating systemOS-independent
PlatformPython
TypePackage manager
LicenseMIT[3]
Websitepip.pypa.io
Repository

pip (also known byPython 3's aliaspip3) is apackage manager (package management system) written inPython and is used to install and manage software packages.[4] ThePython Software Foundation recommends using pip to install Python applications and its dependencies during deployment.[5] Pip connects to an onlinesoftware repository of public packages, named thePython Package Index (PyPI). Pip can be configured to connect to other package repositories (local or remote), provided that they comply toPython Enhancement Proposal 503.[6][7]

Most distributions of Python come with pip preinstalled. Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip by default.[8]

History

[edit]

First introduced as pyinstall in 2008 by Ian Bicking (the creator of the virtualenv package) as an alternative toeasy install,[9][10] pip was chosen as the new name from one of several suggestions that the creator received on his blog post.[11] According to Bicking himself, the name is arecursive acronym for "Pip Installs Packages".[12] In 2011, the Python Packaging Authority (PyPA) was created to take over the maintenance of pip and virtualenv from Bicking, led by Carl Meyer, Brian Rosner, and Jannis Leidel.[10]

With the release of pip version 6.0 (2014-12-22), the version naming process was changed to have version in X.Y format and drop the preceding 1 from the version label.[13]

Command-line interface

[edit]
An output ofpip install virtualenv

Pip'scommand-line interface allows the install of Python software packages by issuing a command:pip install some-package-name

Users can also remove the package by issuing a command:pip uninstall some-package-name

pip has a feature to manage full lists of packages and corresponding version numbers, possible through a "requirements" file.[14] This permits the efficient re-creation of an entire group of packages in a separate environment (e.g. another computer) orvirtual environment. This can be achieved with a properly formatted file and the following command,[15] where requirements.txt is the name of the file:pip install -r requirements.txt.

To install some package for a specific python version, pip provides the following command, where${version} is replaced by 2, 3, 3.4, etc.:pip${version} install some-package-name.

Usingsetup.py

[edit]

Pip provides a way to install user-defined projects locally with the use of asetup.py file. This method requires the Python project to have the following file structure:

example_project/├── exampleproject/      Python package with source code.|    ├── __init__.py     Make the folder a package.|    └── example.py      Example module.└── README.md            README with info of the project.

Within this structure, user can addsetup.py to the root of the project (i.e.example_project for above structure) with the following content:

fromsetuptoolsimportsetup,find_packagessetup(name="example",# Name of the package. This will be used, when the project is imported as a package.version="0.1.0",packages=find_packages(include=["exampleproject","exampleproject.*"])# Pip will automatically install the dependencies provided here.)

After this, pip can install this custom project by running the following command, from the project root directory:pip install -e.

Custom repository

[edit]

Besides the defaultPython Package Index (PyPI) repository, pip supports custom repositories also.[16] Such repositories can be located on a Hypertext Transfer ProtocolHTTP(s) URL, or on afile system.

A custom repository can be specified using the-i or--index-url option, thusly:pip install -i https://your-custom-repo/simple <package name>; or with a filesystem:pip install -i /path/to/your/custom-repo/simple <package name>.

See also

[edit]

References

[edit]
  1. ^"Pip 0.2".Python Package Index (PyPI). Retrieved27 August 2024.
  2. ^pypa."Release 25.3 · pypa/pip". Retrieved25 October 2025.
  3. ^"pip/LICENSE.txt".GitHub. 17 April 2018.Archived from the original on 1 June 2018. Retrieved1 June 2018.
  4. ^Kollár, László."Managing Python packages the right way".Opensource.com.Red Hat. Retrieved23 June 2019.
  5. ^"Tool recommendations — Python Packaging User Guide".packaging.python.org. Retrieved9 November 2022.
  6. ^"Python Enhancement Proposal 503".python.org.
  7. ^"pip install command line documentation".pip.pypa.io.
  8. ^"pip installation". Retrieved24 February 2015.
  9. ^Bicking, Ian (24 September 2008)."pyinstall: A New Hope". Archived fromthe original on 27 September 2008. Retrieved4 March 2020.
  10. ^ab"Packaging History".Python Packaging Authority. Retrieved4 March 2020.
  11. ^Bicking, Ian (1 October 2008)."pyinstall pybundles". Retrieved24 November 2021.
  12. ^Bicking, Ian (28 October 2008)."pyinstall is dead, long live pip!". Retrieved24 November 2021.
  13. ^"Changelog – pip documentation v22.3.1".
  14. ^"pip documentation". The pip developers. Retrieved5 January 2012.
  15. ^Gahlot, Gaurav (6 November 2018)."Most Importantpip Commands for a Python Developer".DZone.com Open Source. Retrieved23 June 2019.
  16. ^"Custom repository with pip install -i". Retrieved12 January 2022.

External links

[edit]
Gaming console
Unix-like,
Linux
dpkg
Purely functional
RPM
tarball
Other
macOS
z/OS
Mobile
operating
systems
Multi-platform
Solaris,illumos
Web browsers
Windows
BSD
C++
Java
JavaScript
Kubernetes
Linux
macOS
.NET
Perl
PHP
Python
Ruby
Rust
Scala
Retrieved from "https://en.wikipedia.org/w/index.php?title=Pip_(package_manager)&oldid=1318662869"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp