fbpx
Wikipedia

pip (package manager)

Pip is a package-management system written in Python and is used to install and manage software packages.[4] The Python Software Foundation recommends using pip for installing Python applications and its dependencies during deployment.[5] Pip connects to an online repository of public packages, called the Python Package Index. Pip can be configured to connect to other package repositories (local or remote), provided that they comply to Python Enhancement Proposal 503.[6][7]

pip
An output of pip --help
Original author(s)Ian Bicking
Initial release4 April 2011 (12 years ago) (2011-04-04)[1]
Stable release
23.1.2[2] / 26 April 2023; 4 days ago (26 April 2023)
Repository
  • github.com/pypa/pip
Written inPython
Operating systemOS-independent
PlatformPython
TypePackage management system
LicenseMIT[3]
Websitepip.pypa.io

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

First introduced as pyinstall in 2008 by Ian Bicking (the creator of the virtualenv package) as an alternative to easy 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 a recursive 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

 
An output of pip install virtualenv

Pip's command-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) or virtual 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 

Using setup.py

Pip provides a way to install user-defined projects locally with the use of setup.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 add setup.py to the root of the project (i.e. example_project for above structure) with the following content:

from setuptools import setup, find_packages setup( 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

Besides the default PyPI repository, Pip supports custom repositories as well.[16] Such repositories can be located on an HTTP(s) URL or on a file system location.

A custom repository can be specified using the -i or—index-url option, like so:

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

References

  1. ^ "Release 1.0". GitHub. from the original on 17 September 2021. Retrieved 4 March 2020.
  2. ^ "Release 23.1.2". 26 April 2023. Retrieved 30 April 2023.
  3. ^ "pip/LICENSE.txt". Github. 17 April 2018. from the original on 1 June 2018. Retrieved 1 June 2018.
  4. ^ Kollár, László. "Managing Python packages the right way". Opensource.com. Red Hat. Retrieved 23 June 2019.
  5. ^ "Tool recommendations — Python Packaging User Guide". packaging.python.org. Retrieved 9 November 2022.
  6. ^ "Python Enhancement Proposal 503". python.org.
  7. ^ "pip install command line documentation". pip.pypa.io.
  8. ^ "pip installation". Retrieved 24 February 2015.
  9. ^ Bicking, Ian (24 September 2008). . Archived from the original on 27 September 2008. Retrieved 4 March 2020.
  10. ^ a b "Packaging History". Python Packaging Authority. Retrieved 4 March 2020.
  11. ^ Bicking, Ian (1 October 2008). "pyinstall pybundles". Retrieved 24 November 2021.
  12. ^ Bicking, Ian (28 October 2008). "pyinstall is dead, long live pip!". Retrieved 24 November 2021.
  13. ^ "Changelog - pip documentation v22.3.1".
  14. ^ "pip documentation". The pip developers. Retrieved 5 January 2012.
  15. ^ Gahlot, Gaurav (6 November 2018). "Most Important pip Commands for a Python Developer - DZone Open Source". dzone.com. Retrieved 23 June 2019.
  16. ^ "Custom repository with pip install -i". Retrieved 12 January 2022.

External links

  • Official Pip website
  • Python Packaging Authority

package, manager, this, article, relies, excessively, references, primary, sources, please, improve, this, article, adding, secondary, tertiary, sources, find, sources, package, manager, news, newspapers, books, scholar, jstor, november, 2022, learn, when, rem. This article relies excessively on references to primary sources Please improve this article by adding secondary or tertiary sources Find sources Pip package manager news newspapers books scholar JSTOR November 2022 Learn how and when to remove this template message Pip is a package management system written in Python and is used to install and manage software packages 4 The Python Software Foundation recommends using pip for installing Python applications and its dependencies during deployment 5 Pip connects to an online repository of public packages called the Python Package Index Pip can be configured to connect to other package repositories local or remote provided that they comply to Python Enhancement Proposal 503 6 7 pipAn output of pip helpOriginal author s Ian BickingInitial release4 April 2011 12 years ago 2011 04 04 1 Stable release23 1 2 2 26 April 2023 4 days ago 26 April 2023 Repositorygithub wbr com wbr pypa wbr pipWritten inPythonOperating systemOS independentPlatformPythonTypePackage management systemLicenseMIT 3 Websitepip wbr pypa wbr ioMost 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 Contents 1 History 2 Command line interface 2 1 Using setup py 3 Custom repository 4 See also 5 References 6 External linksHistory EditFirst introduced as pyinstall in 2008 by Ian Bicking the creator of the virtualenv package as an alternative to easy 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 a recursive 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 of pip install virtualenv Pip s command 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 or virtual 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 Using setup py Edit Pip provides a way to install user defined projects locally with the use of setup 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 add setup py to the root of the project i e example project for above structure with the following content from setuptools import setup find packages setup 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 EditBesides the default PyPI repository Pip supports custom repositories as well 16 Such repositories can be located on an HTTP s URL or on a file system location A custom repository can be specified using the i or index url option like so pip install i https your custom repo simple lt package name gt Or with a filesystem pip install i path to your custom repo simple lt package name gt See also EditSetuptools Pipenv Python Poetry Conda package manager for Anaconda distribution PyPM ActiveState s proprietary package managerReferences Edit Release 1 0 GitHub Archived from the original on 17 September 2021 Retrieved 4 March 2020 Release 23 1 2 26 April 2023 Retrieved 30 April 2023 pip LICENSE txt Github 17 April 2018 Archived from the original on 1 June 2018 Retrieved 1 June 2018 Kollar Laszlo Managing Python packages the right way Opensource com Red Hat Retrieved 23 June 2019 Tool recommendations Python Packaging User Guide packaging python org Retrieved 9 November 2022 Python Enhancement Proposal 503 python org pip install command line documentation pip pypa io pip installation Retrieved 24 February 2015 Bicking Ian 24 September 2008 pyinstall A New Hope Archived from the original on 27 September 2008 Retrieved 4 March 2020 a b Packaging History Python Packaging Authority Retrieved 4 March 2020 Bicking Ian 1 October 2008 pyinstall pybundles Retrieved 24 November 2021 Bicking Ian 28 October 2008 pyinstall is dead long live pip Retrieved 24 November 2021 Changelog pip documentation v22 3 1 pip documentation The pip developers Retrieved 5 January 2012 Gahlot Gaurav 6 November 2018 Most Important pip Commands for a Python Developer DZone Open Source dzone com Retrieved 23 June 2019 Custom repository with pip install i Retrieved 12 January 2022 External links EditOfficial Pip website Python Packaging Authority Retrieved from https en wikipedia org w index php title Pip package manager amp oldid 1145221600, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.