Pip (package manager)

Last updated

pip
Original author(s) Ian Bicking
Initial release4 April 2011(12 years ago) (2011-04-04) [1]
Stable release
24.0 [2]   OOjs UI icon edit-ltr-progressive.svg / 3 February 2024;1 day ago (3 February 2024)
Repository
Written in Python
Operating system OS-independent
Platform Python
Type Package management system
License MIT [3]
Website pip.pypa.io

pip (also known by Python 3's alias pip3) 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]

Contents

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 install virtualenv.png
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:

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

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

Related Research Articles

<span class="mw-page-title-main">Portage (software)</span> Gentoo package management system

Portage is a package management system originally created for and used by Gentoo Linux and also by ChromeOS, Calculate, Sabayon, and Funtoo Linux among others. Portage is based on the concept of ports collections. Gentoo is sometimes referred to as a meta-distribution due to the extreme flexibility of Portage, which makes it operating-system-independent. The Gentoo/Alt project was concerned with using Portage to manage other operating systems, such as BSDs, macOS and Solaris. The most notable of these implementations is the Gentoo/FreeBSD project.

<span class="mw-page-title-main">README</span> Software information file

In software development, a README file contains information about the other files in a directory or archive of computer software. A form of documentation, it is usually a simple plain text file called README, Read Me, READ.ME, README.TXT, README.md, or README.1ST.

Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by The Apache Software Foundation, where it was formerly part of the Jakarta Project.

eric (software)

eric is a free integrated development environment (IDE) used for computer programming. Since it is a full featured IDE, it provides by default all necessary tools needed for the writing of code and for the professional management of a software project.

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries, a tool designed to easily manage the installation of gems, and a server for distributing them. It was created by Chad Fowler, Jim Weirich, David Alan Black, Paul Brannan and Richard Kilmer during RubyConf 2004.

<span class="mw-page-title-main">Software remastering</span>

Software remastering is software development that recreates system software and applications while incorporating customizations, with the intent that it is copied and run elsewhere for "off-label" usage. The term comes from remastering in media production, where it is similarly distinguished from mere copying.

A software repository, or repo for short, is a storage location for software packages. Often a table of contents is also stored, along with metadata. A software repository is typically managed by source or version control, or repository managers. Package managers allow automatically installing and updating repositories, sometimes called "packages".


The Wing Python IDE is a family of integrated development environments (IDEs) from Wingware created specifically for the Python programming language, with support for editing, testing, debugging, inspecting/browsing, and error checking Python code.

<span class="mw-page-title-main">Python Package Index</span> Software repository

The Python Package Index, abbreviated as PyPI and also known as the Cheese Shop, is the official third-party software repository for Python. It is analogous to the CPAN repository for Perl and to the CRAN repository for R. PyPI is run by the Python Software Foundation, a charity. Some package managers, including pip, use PyPI as the default source for packages and their dependencies.

setuptools Package development process library

setuptools is a package development process library designed to facilitate packaging Python projects by enhancing the Python standard library distutils. It includes:

<span class="mw-page-title-main">OCRFeeder</span>

OCRFeeder is an optical character recognition suite for GNOME, which also supports virtually any command-line OCR engine, such as CuneiForm, GOCR, Ocrad and Tesseract. It converts paper documents to digital document files and can serve to make them accessible to visually impaired users.

<span class="mw-page-title-main">Sublime Text</span> Text editor

Sublime Text is a shareware text and source code editor available for Windows, macOS, and Linux. It natively supports many programming languages and markup languages. Users can customize it with themes and expand its functionality with plugins, typically community-built and maintained under free-software licenses. To facilitate plugins, Sublime Text features a Python API. The editor utilizes minimal interface and contains features for programmers including configurable syntax highlighting, code folding, search-and-replace supporting regular-expressions, terminal output window, and more. It is proprietary software, but a free evaluation version is available.

<span class="mw-page-title-main">Spyder (software)</span> IDE for scientific programming in Python

Spyder is an open-source cross-platform integrated development environment (IDE) for scientific programming in the Python language. Spyder integrates with a number of prominent packages in the scientific Python stack, including NumPy, SciPy, Matplotlib, pandas, IPython, SymPy and Cython, as well as other open-source software. It is released under the MIT license.

LuaRocks is a package manager for the Lua programming language that provides a standard format for distributing Lua modules, a tool designed to easily manage the installation of rocks, and a server for distributing them. While not included with the Lua distribution, it has been called the "de facto package manager for community-contributed Lua modules".

<span class="mw-page-title-main">Anaconda (Python distribution)</span> Distribution of the Python and R languages for scientific computing

Anaconda is a distribution of the Python and R programming languages for scientific computing, that aims to simplify package management and deployment. The distribution includes data-science packages suitable for Windows, Linux, and macOS. It is developed and maintained by Anaconda, Inc., which was founded by Peter Wang and Travis Oliphant in 2012. As an Anaconda, Inc. product, it is also known as Anaconda Distribution or Anaconda Individual Edition, while other products from the company are Anaconda Team Edition and Anaconda Enterprise Edition, neither of which are free.

Conda is an open-source, cross-platform, language-agnostic package manager and environment management system. It was originally developed to solve difficult package management challenges faced by Python data scientists, and today is a popular package manager for Python and R. At first part of Anaconda Python distribution developed by Anaconda Inc. Later, it was spun out as a separate package, released under the BSD license. The Conda package and environment manager is included in all versions of Anaconda, Miniconda, and Anaconda Repository. Conda is a NumFOCUS affiliated project.

<span class="mw-page-title-main">Meson (software)</span> Build automation system

Meson is a software tool for automating the building (compiling) of software. The overall goal for Meson is to promote programmer productivity. Meson is free and open-source software written in Python, under the Apache License 2.0.

qutebrowser Free keyboard-focused web browser with a minimal GUI

qutebrowser is a QtWebEngine web browser for Linux, Windows, and macOS operating systems with Vim-style key bindings and a minimal GUI. It is keyboard-driven and is inspired by similar software such as Vimperator and dwb. It uses DuckDuckGo as the default search engine. qutebrowser is included in the native repositories of Linux distributions such as Fedora and Arch Linux. qutebrowser is developed by Florian Bruhin, for which he received a CH Open Source award in 2016.

References

  1. "Release 1.0". GitHub . Archived from the original on 17 September 2021. Retrieved 4 March 2020.
  2. "Release 24.0".
  3. "pip/LICENSE.txt". Github. 17 April 2018. Archived 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). "pyinstall: A New Hope". Archived from the original on 27 September 2008. Retrieved 4 March 2020.
  10. 1 2 "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.