How to install pip on linux
How to install pip on linux
How To Install PIP to Manage Python Packages in Linux
Pip (recursive acronym for βPip Installs Packagesβ or βPip Installs Pythonβ) is a cross-platform package manager for installing and managing Python packages (which can be found in the Python Package Index (PyPI)) that comes with Python 2 >=2.7.9 or Python 3 >=3.4 binaries that are downloaded from python.org.
In this article, we will explain how to install PIP on mainstream Linux distributions.
Note: We will run all commands as the root user, if you are managing your system as a normal user, then use the sudo command to get root privileges or you can as well configure your system to run sudo command without entering a password, itβs possible. Try it out!
Install PIP in Linux Systems
To install pip in Linux, run the appropriate command for your distribution as follows:
Install PIP On Debian/Ubuntu
Install PIP On CentOS and RHEL
Unluckily, pip is not packaged in official software repositories of CentOS/RHEL. So you need to enable the EPEL repository and then install it like this.
Install PIP on Fedora
Install PIP on Arch Linux
Install PIP on openSUSE
How to Use PIP in Linux Systems
To install, uninstall or search new packages, use these commands.
To see a list of all commands type:
Sample Output
You may also like to read these following related articles about Python.
In this article, we showed you how to install PIP on mainstream Linux distributions. To ask any questions relating to this topic, please take advantage of the feedback form below.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² Ubuntu
Π‘ΡΡΠ΅ΡΡΠ²ΡΠ΅Ρ Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΎ ΡΠΏΠΎΡΠΎΠ±ΠΎΠ² ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΠΎΠ³ΠΎ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠ΅Π½ΠΈΡ Π² Ubuntu. ΠΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΠ΅Π½ΡΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ, ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ deb-ΠΏΠ°ΠΊΠ΅Ρ, ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠΈΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ PPA, ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Snap-ΠΏΠ°ΠΊΠ΅ΡΡ, Flatpack ΠΈΠ»ΠΈ AppImage ΠΈΠ»ΠΈ Π΄Π°ΠΆΠ΅ ΡΠΎΠ±ΡΠ°ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΈΠ· ΠΈΡΡ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΊΠΎΠ΄Π°.
Π§ΡΠΎ ΡΠ°ΠΊΠΎΠ΅ PIP?
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² Ubuntu 20.04
Π£ΡΠΈΠ»ΠΈΡΠ° PIP Π½Π΅ ΠΏΠΎΡΡΠ°Π²Π»ΡΠ΅ΡΡΡ Π² Ubuntu ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ. ΠΡΠ»ΠΈ ΠΎΠ½Π° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠ°, Π΅Ρ ΠΏΡΠΈΠ΄ΡΡΡΡ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ. ΠΡΠΎ ΠΎΡΠ΅Π½Ρ ΠΏΡΠΎΡΡΠΎ, Π½ΠΎ Π΅ΡΡΡ ΠΎΠ΄ΠΈΠ½ ΠΌΠΎΠΌΠ΅Π½Ρ, ΠΎ ΠΊΠΎΡΠΎΡΠΎΠΌ Π½Π°Π΄ΠΎ Π·Π½Π°ΡΡ. Π’Π°ΠΊ ΠΊΠ°ΠΊ ΡΡΡΠ΅ΡΡΠ²ΡΠ΅Ρ 2 Π²Π΅ΡΡΠΈΠΈ ΡΠ·ΡΠΊΠ° Python β Python 2 ΠΈ Python 3, ΡΠΎ Π΄Π°Π½Π½Π°Ρ ΡΡΠΈΠ»ΠΈΡΠ° Π½Π°Π·ΡΠ²Π°Π΅ΡΡΡ Π΄Π»Ρ ΠΊΠ°ΠΆΠ΄ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ ΡΠ·ΡΠΊΠ° ΠΏΠΎ-ΡΠ²ΠΎΠ΅ΠΌΡ. ΠΠ»Ρ Python 2 ΡΡΠΎ PIP, Π° Π΄Π»Ρ Python 3 ΡΡΠΎ PIP3
Π Ubuntu 20.04 ΠΏΠΎ ΡΠΌΠΎΠ»ΡΠ°Π½ΠΈΡ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ Python ΡΠΎΠ»ΡΠΊΠΎ 3 Π²Π΅ΡΡΠΈΠΈ. Π‘ΠΎΠΎΡΠ²Π΅ΡΡΡΠ²Π΅Π½Π½ΠΎ ΠΏΠ°ΠΊΠ΅Ρ Π΄Π»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ Π±ΡΠ΄Π΅Ρ Π½Π°Π·ΡΠ²Π°ΡΡΡΡ PIP3. ΠΠ±ΡΠ°ΡΠΈΡΠ΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, ΡΡΠΎ Π΄Π»Ρ Π½Π°ΠΏΠΈΡΠ°Π½ΠΈΡ ΡΡΠΎΠΉ ΡΡΠ°ΡΡΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π»ΡΡ Π°Π»Π³ΠΎΡΠΈΡΠΌ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ Π΄Π»Ρ Ubuntu 20.04, Π½ΠΎ Π½ΠΈΠΆΠ΅ΠΏΡΠΈΠ²Π΅Π΄ΡΠ½Π½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΠΏΠΎΠ΄ΠΎΠΉΠ΄ΡΡ ΠΈ Π΄Π»Ρ Π±ΠΎΠ»Π΅Π΅ ΡΠ°Π½Π½ΠΈΡ Π²Π΅ΡΡΠΈΠΉ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π°, Π° ΡΠ°ΠΊΠΆΠ΅ Π΄Π»Ρ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²ΠΎΠ², ΠΎΡΠ½ΠΎΠ²Π°Π½Π½ΡΡ Π½Π° Ubuntu (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ Debian).
Π‘Π½Π°ΡΠ°Π»Π° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠ±Π΅Π΄ΠΈΡΡΡΡ, ΡΡΠΎ Python 3 ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ Π² ΡΠΈΡΡΠ΅ΠΌΠ΅ Π²ΡΠΏΠΎΠ»Π½ΠΈΠ² ΠΊΠΎΠΌΠ°Π½Π΄Ρ Π² ΡΠ΅ΡΠΌΠΈΠ½Π°Π»Π΅:
ΠΠΎΠΌΠ°Π½Π΄Π° Π²ΡΠ²Π΅Π΄Π΅Ρ ΡΠ΅ΠΊΡΡΡΡ Π²Π΅ΡΡΠΈΡ Python, ΠΊΠΎΡΠΎΡΠ°Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ Π² ΡΠΈΡΡΠ΅ΠΌΠ΅. ΠΠ°Π»Π΅Π΅ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ pip3:
ΠΠΎΡΠ»Π΅ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ pip3 Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠ±Π΅Π΄ΠΈΡΡΡΡ, ΡΡΠΎ ΡΡΠΈΠ»ΠΈΡΠ° ΡΡΡΠ°Π½ΠΎΠ²ΠΈΠ»Π°ΡΡ Π² ΡΠΈΡΡΠ΅ΠΌΡ Π±Π΅Π· ΠΎΡΠΈΠ±ΠΎΠΊ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠΎΠΌΠ°Π½Π΄Π° Π²ΡΠ²Π΅Π΄Π΅Ρ Π²Π΅ΡΡΠΈΡ pip ΠΈ ΠΏΠΎΠ»Π½ΡΠΉ ΠΏΡΡΡ ΠΊΡΠ΄Π° Π±ΡΠ»Π° ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π° ΡΡΠΈΠ»ΠΈΡΠ°. Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° pip Π² Ubuntu 20.04 Π·Π°Π²Π΅ΡΡΠ΅Π½Π°, ΡΠ΅ΠΏΠ΅ΡΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠ°Π·ΠΎΠ±ΡΠ°ΡΡΡΡ ΠΊΠ°ΠΊ Π΅ΠΉ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ.
ΠΠ°ΠΊ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ PIP
ΠΠ»Ρ Π½Π°ΡΠ°Π»Π° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΠ°Π·ΠΎΠ±ΡΠ°ΡΡΡΡ Π² ΡΠΈΠ½ΡΠ°ΠΊΡΠΈΡΠ΅ ΡΡΠΈΠ»ΠΈΡΡ ΠΈ ΠΈΠ·ΡΡΠΈΡΡ Π΅Ρ ΠΎΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ. ΠΠ½ΠΈ ΠΏΠΎΠΌΠΎΠ³ΡΡ Π²Π°ΠΌ ΠΈΡΠΊΠ°ΡΡ, ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ ΠΈ ΡΠ΄Π°Π»ΡΡΡ ΠΏΠ°ΠΊΠ΅ΡΡ. Π‘ΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΡΡΠΈΠ»ΠΈΡΡ Π΄ΠΎΠ²ΠΎΠ»ΡΠ½ΠΎ ΠΏΡΠΎΡΡ:
$ pip3 ΠΊΠΎΠΌΠ°Π½Π΄Π° ΠΎΠΏΡΠΈΠΈ ΠΈΠΌΡ_ΠΏΠ°ΠΊΠ΅ΡΠ°
ΠΠΎΡ ΠΎΡΠ½ΠΎΠ²Π½ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ:
Π£ pip Π΄ΠΎΡΡΠ°ΡΠΎΡΠ½ΠΎ ΠΌΠ½ΠΎΠ³ΠΎ ΡΠ°Π·Π½ΡΡ ΠΎΠΏΡΠΈΠΉ ΠΈ ΠΊΠΎΠΌΠ°Π½Π΄, ΠΏΠΎΡΡΠΎΠΌΡ Π·Π΄Π΅ΡΡ Π²ΡΠ΅ ΠΎΠ½ΠΈ ΠΎΠΏΠΈΡΠ°Π½Ρ Π½Π΅ Π±ΡΠ΄ΡΡ. ΠΠ»Ρ ΠΏΡΠΎΡΠΌΠΎΡΡΠ° Π²ΡΠ΅Ρ ΠΊΠΎΠΌΠ°Π½Π΄ ΠΈ ΠΎΠΏΡΠΈΠΉ ΠΊ Π½ΠΈΠΌ ΠΌΠΎΠΆΠ½ΠΎ Π²ΡΠ·Π²Π°ΡΡ ΡΠΏΡΠ°Π²ΠΊΡ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ ΠΊΠΎΠΌΠ°Π½Π΄Ρ
ΠΠ»Ρ ΠΏΠΎΠΈΡΠΊΠ° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΡ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΠΏΠ΅ΡΠ΅ΠΉΠ΄ΠΈΡΠ΅ Π½Π° ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΡΠΉ ΡΠ°ΠΉΡ pypi:
Π ΠΏΠΎΠ»Π΅ ΠΏΠΎΠΈΡΠΊΠ° Π²Π²Π΅Π΄ΠΈΡΠ΅ ΠΈΠΌΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°. ΠΠ°Π»Π΅Π΅ Π½Π°ΠΆΠΌΠΈΡΠ΅ Π½Π° ΠΊΠ»Π°Π²ΠΈΡΡ Enter ΠΈΠ»ΠΈ Π½Π° Π·Π½Π°ΡΠΎΠΊ Π»ΡΠΏΡ, ΠΊΠΎΡΠΎΡΡΠΉ Π½Π°Ρ ΠΎΠ΄ΠΈΡΡΡΡ ΡΠΏΡΠ°Π²Π° ΠΎΡ ΡΡΡΠΎΠΊΠΈ ΠΏΠΎΠΈΡΠΊΠ°:
Π ΡΠ΅Π·ΡΠ»ΡΡΠ°ΡΠ΅ ΠΏΠΎΠΈΡΠΊΠ° Π±ΡΠ΄ΡΡ ΠΎΡΠΎΠ±ΡΠ°ΠΆΠ΅Π½Ρ Π²ΡΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ, Π² ΠΈΠΌΠ΅Π½Π°Ρ ΠΊΠΎΡΠΎΡΡΡ ΡΠΎΠ΄Π΅ΡΠΆΠΈΡΡΡ ΡΠ»ΠΎΠ²ΠΎ, ΠΊΠΎΡΠΎΡΠΎΠ΅ Π±ΡΠ»ΠΎ Π²Π²Π΅Π΄Π΅Π½ΠΎ Π² ΠΏΠΎΠΈΡΠΊΠΎΠ²ΡΡ ΡΡΡΠΎΠΊΡ. ΠΠ΅ΡΠ΅ΠΉΠ΄ΠΈΡΠ΅ Π½Π° ΡΡΡΠ°Π½ΠΈΡΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ° ΠΈ ΠΎΡΠΎΠ±ΡΠ°Π·ΠΈΡΡΡ ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎΠ΅ ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΎ Π΄Π°Π½Π½ΠΎΠΌ ΠΏΠ°ΠΊΠ΅ΡΠ΅ β ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ΅, ΠΏΡΠΈΠΌΠ΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ, ΠΈΡΡΠΎΡΠΈΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ ΠΈ Ρ.Π΄.
ΠΠ° ΡΡΡΠ°Π½ΠΈΡΠ΅ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ° ΠΏΡΠΈΡΡΡΡΡΠ²ΡΠ΅Ρ ΠΊΠΎΠΌΠ°Π½Π΄Π° Π΄Π»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ. ΠΠ½Π° ΡΠ°ΡΠΏΠΎΠ»Π°Π³Π°Π΅ΡΡΡ ΠΏΠΎΠ΄ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ΠΌ ΠΏΠ°ΠΊΠ΅ΡΠ°. Π‘ΠΊΠΎΠΏΠΈΡΡΠΉΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΈ Π²ΡΡΠ°Π²ΡΡΠ΅ Π² ΠΎΠΊΠ½ΠΎ ΡΠ΅ΡΠΌΠΈΠ½Π°Π»Π°. ΠΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅Ρ Π±ΡΠ΄Π΅Ρ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ Π² ΡΠΈΡΡΠ΅ΠΌΡ. ΠΠ°ΠΏΡΠΈΠΌΠ΅Ρ:
sudo pip3 install s-tui
Π‘ΡΠΎΠΈΡ ΠΎΠ±ΡΠ°ΡΠΈΡΡ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅ ΡΡΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ pip ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΡΡ ΠΎΡ ΠΈΠΌΠ΅Π½ΠΈ ΡΡΠΏΠ΅ΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ (Π² Π΄Π°Π½Π½ΠΎΠΌ ΡΠ»ΡΡΠ°Π΅ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ sudo). ΠΠΎΡΠ»Π΅ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ ΠΌΠΎΠΆΠ½ΠΎ Π·Π°ΠΏΡΡΡΠΈΡΡ, Π²Π²Π΅Π΄Ρ Π² ΡΠ΅ΡΠΌΠΈΠ½Π°Π»Π΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
Π’Π΅ΠΏΠ΅ΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° ΠΎΡΠΎΠ±ΡΠ°Π·ΠΈΡΡΡ Π² ΡΠΏΠΈΡΠΊΠ΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΡ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²:
Π§ΡΠΎΠ±Ρ ΡΠ΄Π°Π»ΠΈΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ, Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΊΠΎΠΌΠ°Π½Π΄Ρ uninstall:
sudo pip3 uninstall s-tui
Π£Π΄Π°Π»Π΅Π½ΠΈΠ΅ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΠΈ pip ΡΠ°ΠΊ ΠΆΠ΅, ΠΊΠ°ΠΊ ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡΡΡΡ ΠΎΡ ΠΈΠΌΠ΅Π½ΠΈ ΡΡΠΏΠ΅ΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Ρ. ΠΡΠΈ ΠΏΠΎΡΠ²Π»Π΅Π½ΠΈΠΈ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ Proceed (y/n/)? Π²Π²Π΅Π΄ΠΈΡΠ΅ y Π½Π°ΠΆΠΌΠΈΡΠ΅ Π½Π° ΠΊΠ»Π°Π²ΠΈΡΡ Enter. ΠΠΎΡΠ»Π΅ ΡΡΠΎΠ³ΠΎ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ° Π±ΡΠ΄Π΅Ρ ΠΏΠΎΠ»Π½ΠΎΡΡΡΡ ΡΠ΄Π°Π»Π΅Π½Π° ΠΈΠ· ΡΠΈΡΡΠ΅ΠΌΡ. ΠΠ»Ρ Π²Π΅ΡΡΠΈΠΈ pip ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Π½ΠΎΠΉ Π΄Π»Ρ Python 2 Π²ΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ Π°Π½Π°Π»ΠΎΠ³ΠΈΡΠ½Ρ.
ΠΡΠ²ΠΎΠ΄Ρ
Π Π΄Π°Π½Π½ΠΎΠΉ ΡΡΠ°ΡΡΠ΅ Π±ΡΠ»Π° ΡΠ°ΡΡΠΌΠΎΡΡΠ΅Π½Π° ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΡΠΈΠ»ΠΈΡΡ pip Π΄Π»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² Π΄Π»Ρ ΡΠ·ΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Python Π²Π΅ΡΡΠΈΠΈ 3. ΠΡΠ»ΠΈ Ρ Π²Π°Ρ ΠΎΡΡΠ°Π»ΠΈΡΡ Π²ΠΎΠΏΡΠΎΡΡ, ΡΠΏΡΠ°ΡΠΈΠ²Π°ΠΉΡΠ΅ Π² ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΡΡ !
How to Install PIP on Windows/Linux? [A Complete Guide]
Are you looking for the Python PIP Installation guide? Then this blog post about how to install pip on windows will help you to make it happen?
List of content you will read in this article:
When you are dealing with Python, there is a requirement of tons of packages, you can use the available ones with the help of the default package manager, however, PIP might be required to install some. PIP or Package Installer for Python. You can install the software packages or libraries that are not included in the Python Standard Library.
Moreover, if you seek to install some additional dependencies or packages, you can simply install PIP on Windows and Linux operating systems. PIP uses Python Package Index for all the packages. You must be familiar with the term, package manager if you know the programming world. This tutorial will guide you, how to install PIP on Windows and Linux?
Let us now head towards the process of installing PIP in Windows first!
How to install PIP on Windows? [A Step by Step Guide]
Let’s move to understand the complete step/procedure.
Python 3.7.0 (v3.7.0:1bf9cc5093, Jan 25 2019, 07:44:31) [MSC v.1914 64 bit (AMD64)] on win32
Type «help», «copyright», «credits» or «license» for more information.
Let us now quickly move to understand how to install PIP on Windows process.
Follow these steps to achieve your task:
Step 1: You need to download PIP get-pip.py
You have to download get-pip.py before installing PIP. Now, remember the location where you save the file as this path is required in the process later.
Step 2: Open the Windows Command Line
The next step is to open the Command prompt window. Simply follow these steps:
If not these steps, then you can simply type cmd in the search bar and the command prompt will be displayed on your screen.
Additionally, there are instances where you have to run/access the prompt window as an administrator. Now, when can you encounter these situations? Sometimes, while you perform a task, you may encounter a message saying that you do not have access to some specific permissions in order to run an application or a program. In such situations, you are required to run the app as an admin.
In order to conclude that, click right on the Command Prompt and choose βRun asβ, then select As Administrator. And youβre done!
Step 3: Install PIP on Windows
Now, open the Command Prompt, and type the cd command, and then the path where you saved the get-pip.py file. Remember?
Cross-check the fileβs path as this can later cause a problem in the installation process.
Now, follow this command:
After this, the installation process begins.
Moving on, in order to display the list of your current directory, type:
Step 4: Check PIP version
If you wish to see the version of your PIP, go to the Command Prompt and type the following command:
The current version displays on the screen.
Step 5: Installation verification
As you had earlier initiated the process of installation, now you can check whether the process is successful or not.
If your installation is successful, you will encounter this message.
pip 18.0 from c:\users\administrator\appdata\local\programs\python\lib\site-packages\pip (python 3.7)
If not, kindly repeat your installation.
Step 6: How to configure?
The PIP configuration file in Windows is %HOME%\pip\pip.ini located at %APPDATA%\pip\pip.ini. Now, if you want to set the location as per your wish, use PIP_Config_File.
Moreover, if you further wish to upgrade your PIP version, you can do that. It discards the older version and installs the latest one. To accomplish this task, type the following command:
Moving onto the last segment, what if you want to downgrade the installed PIP version in your system? Well, you may think, why is this necessary?
Well, there are times when you install a new version and it does not work seamlessly. To sort that issue, you need to downgrade the version to revert to the previously installed version. Use this command:
Thatβs it! Yes, it is this simple process through which you will be able how to install PIP on Windows. Let us head towards our next segment.
How to install PIP on Linux? [A Step by Step Guide]
Now, Python Package Index is used by PIP as the default source for the packages. Hence, when you type,
pip install package_name
This command scans for the mentioned package in PyPI. As soon as it finds the package, it downloads and installs it. Now, it depends on which version either Python pip or Python3-pip, youβre working with.
Here is a step-by-step guide to the whole process screenshot.
Step 1: Start by typing the following command:
Sudo apt-get install python3-pip python-dev
Step 2: Next up, you will see this window.
Here, the installer is simply providing the disk space.
Step 3: Next, it downloads the libraries as shown below.
Step 4: Now, all the files and packages start unpacking.
Step 5: Lastly, the few more steps of the installation look like this.
General syntax:
As we have taken the example of the Numpy library, just write NumPy in the place of the package name. Here is how:
# pip3 install numpy
Step 6: Moving on, letβs say you want to search for the availability of some packages, use this command:
# pip3 search numpy
Step 7: Next, to know all the Python packages installed in the system, follow this command:
To gain any additional information about the installed packages, use the following:
# pip3 show numpy
Step 8: Now, finally, if you wish to uninstall the packages, use this simple command:
# pip3 uninstall numpy
Conclusion
We hope that with the help of this article, you have successfully learned how to install PIP on Windows and Linux operating systems. You can now easily manage your packages with the help of Python PIP. If you faced any issues during the installation process or have any questions, please leave them via the listed comment box below.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ PIP Π² Linux
Π§ΡΠΎ ΡΠ°ΠΊΠΎΠ΅ PIP
Pip (ΡΠΎΠΊΡΠ°ΡΠ΅Π½ΠΈΠ΅ ΠΎΡ Python Installs Packages) β ΡΡΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ½ΡΠΉ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ Π΄Π»Ρ ΡΠ·ΡΠΊΠ° ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ Python.
ΠΡ ΠΏΡΠΈΠ²ΡΠΊΠ»ΠΈ ΠΊ ΠΏΠ°ΠΊΠ΅ΡΠ½ΡΠΌ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ°ΠΌ Π² Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π°Ρ Linux. Π§Π΅ΡΠ΅Π· Π½ΠΈΡ ΠΌΡ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈ ΡΠ΄Π°Π»ΡΠ΅ΠΌ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ, Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ, Π΄ΡΠ°ΠΉΠ²Π΅ΡΠ° ΠΈ Π΄ΡΡΠ³ΠΈΠ΅ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½ΡΡ ΡΠΈΡΡΠ΅ΠΌΡ.
ΠΠ»Ρ Π½Π΅ΠΊΠΎΡΠΎΡΡΡ ΡΠ·ΡΠΊΠΎΠ² ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ, ΡΠ°ΠΊΠΆΠ΅ Π±ΡΠ»ΠΈ ΡΠΎΠ·Π΄Π°Π½Ρ ΠΏΠ°ΠΊΠ΅ΡΠ½ΡΠ΅ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΡ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΏΡΠ΅Π΄Π½Π°Π·Π½Π°ΡΠ΅Π½Ρ Π΄Π»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ², Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΡΡ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠΌΡ ΡΠ·ΡΠΊΡ. ΠΠ°ΠΏΡΠΈΠΌΠ΅Ρ, Π΄Π»Ρ ΡΠ·ΡΠΊΠ° Ruby Π΅ΡΡΡ gem, Π° Π΄Π»Ρ Node.js Π΅ΡΡΡ npm. Pip β ΡΡΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ½ΡΠΉ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ Π΄Π»Ρ ΡΠ·ΡΠΊΠ° Python.
Pip ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ ΠΈ ΡΠΏΡΠ°Π²Π»ΡΡΡ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠ½ΡΠΌΠΈ ΠΏΠ°ΠΊΠ΅ΡΠ°ΠΌΠΈ, Π½Π°ΠΏΠΈΡΠ°Π½Π½ΡΠΌΠΈ Π½Π° Python. Π Π°Π±ΠΎΡΠ° Ρ PIP Π²ΡΠΏΠΎΠ»Π½ΡΠ΅ΡΡΡ ΡΠ΅ΡΠ΅Π· ΠΊΠΎΠΌΠ°Π½Π΄Π½ΡΡ ΡΡΡΠΎΠΊΡ.
Pip ΠΏΠΎΠ·Π²ΠΎΠ»ΡΠ΅Ρ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ Π»ΡΠ±ΡΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ ΠΈΠ· ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ Python Package Index (PyPl). ΠΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΈ Π΄ΡΡΠ³ΠΈΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ, Π½ΠΎ ΠΎΠ±ΡΡΠ½ΠΎ Π²ΡΠ΅ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎΠ΅ Π΄ΠΎΡΡΡΠΏΠ½ΠΎ Π² PyPl.
ΠΠ°ΠΊΡΡ Π²Π΅ΡΡΠΈΡ PIP ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ
Π Π½Π°ΡΡΠΎΡΡΠ΅Π΅ Π²ΡΠ΅ΠΌΡ Python 3 ΡΠ²Π»ΡΠ΅ΡΡΡ ΡΠ°ΠΌΠΎΠΉ ΡΠ²Π΅ΠΆΠ΅ΠΉ Π²Π΅ΡΡΠΈΠ΅ΠΉ ΡΠ·ΡΠΊΠ° Python.
ΠΠ½ΠΎΠ³ΠΈΠ΅ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Ρ Linux ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΎΠΉ Python 3. Python 2 ΡΠΆΠ΅ ΠΏΠΎΡΡΠΈ Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡΡ ΠΈ Π΄Π»Ρ Π΅Π³ΠΎ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΈ Π½ΡΠΆΠ½ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ Π² ΡΠΈΡΡΠ΅ΠΌΡ.
ΠΠΎΡΡΠΎΠΌΡ, Π΅ΡΠ»ΠΈ Π²Ρ Π½Π΅ Π·Π½Π°Π΅ΡΠ΅, ΠΊΠ°ΠΊΡΡ Π²Π΅ΡΡΠΈΡ PIP ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ, ΡΠΎ, ΡΠΊΠΎΡΠ΅Π΅ Π²ΡΠ΅Π³ΠΎ, Π²Π°ΠΌ ΠΈ Π±ΠΎΠ»ΡΡΠΈΠ½ΡΡΠ²Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΉ Π½ΡΠΆΠ½ΠΎ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ PIP ΠΈΠΌΠ΅Π½Π½ΠΎ Π΄Π»Ρ Python 3.
ΠΡΠ»ΠΈ ΡΡΠ΅Π±ΡΠ΅ΡΡΡ PIP Π΄Π»Ρ Python 2, ΡΠΎ Π΅Π³ΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΡΠΎΠ²ΠΌΠ΅ΡΡΠ½ΠΎ Ρ 3-ΠΉ Π²Π΅ΡΡΠΈΠ΅ΠΉ.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP
Π Π°ΡΡΠΌΠΎΡΡΠΈΠΌ, ΠΊΠ°ΠΊ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ PIP Π² ΡΠ°Π·Π»ΠΈΡΠ½ΡΡ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π°Ρ Linux.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² Ubuntu Linux (Linux Mint)
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP Π² Ubuntu Linux ΠΈ Π΄ΡΡΠ³ΠΈΡ ΠΏΡΠΎΠΈΠ·Π²ΠΎΠ΄Π½ΡΡ ΠΎΡ Π½Π΅Π³ΠΎ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π°Ρ ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΡΠ°ΡΠ½ΡΠ΅ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ Ubuntu.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π΄Π»Ρ Python 3 Π² Ubuntu
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP Π΄Π»Ρ Python 3 Π²ΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ Π² ΡΠ΅ΡΠΌΠΈΠ½Π°Π»Π΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠΎΠΌΠ°Π½Π΄Π° Π΄Π»Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ PIP 3 Π² Ubuntu: pip3
ΠΠΎΡΠ»Π΅ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡΠΎΠ²Π΅ΡΠΈΡΡ Π²Π΅ΡΡΠΈΡ PIP. ΠΠ»Ρ ΡΡΠΎΠ³ΠΎ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π΄Π»Ρ Python 2 Π² Ubuntu
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP Π΄Π»Ρ Python 2 Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΠΏΠ°ΠΊΠ΅Ρ python-pip. ΠΠΎ Π²ΡΠ΅ΠΌΡ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ Π±ΡΠ΄Π΅Ρ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½ Python 2 (Π΅ΡΠ»ΠΈ ΠΎΠ½ ΡΠΆΠ΅ Π½Π΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½), ΡΠ°ΠΊ ΠΊΠ°ΠΊ ΠΎΠ½ Π²Ρ ΠΎΠ΄ΠΈΡ Π² Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΡΡΠΎΠ³ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ°. ΠΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠΎΠΌΠ°Π½Π΄Π° Π΄Π»Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ PIP 2 Π² Ubuntu: pip
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² Fedora Linux
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 3 Π² Fedora Linux Π²ΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 2 Π² Fedora Linux:
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² Arch Linux
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 3 Π² Arch Linux Π²ΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 2 Π² Arch Linux:
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° PIP Π² openSUSE
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 3 Π² openSUSE Π²ΡΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ:
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ PIP 2 Π² openSUSE:
ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ PIP
Π‘ΠΈΠ½ΡΠ°ΠΊΡΠΈΡ ΠΊΠΎΠΌΠ°Π½Π΄Ρ pip3 (Π² Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ ΠΎΡ Π΄ΠΈΡΡΡΠΈΠ±ΡΡΠΈΠ²Π° ΠΈ Π²Π΅ΡΡΠΈΠΈ Π½Π°Π·Π²Π°Π½ΠΈΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΠΌΠΎΠΆΠ΅Ρ ΠΎΡΠ»ΠΈΡΠ°ΡΡΡΡ):
ΠΡΠΈΠΌΠ΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ: pip install numpy
ΠΊΠΎΠΌΠ°Π½Π΄Π° β ΡΡΠΎ Π΄Π΅ΠΉΡΡΠ²ΠΈΠ΅, ΠΊΠΎΡΠΎΡΠΎΠ΅ Π½Π΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡ. Π‘ΠΏΠΈΡΠΎΠΊ ΡΠ°ΡΡΠΎ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΡ
ΠΊΠΎΠΌΠ°Π½Π΄:
install β ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ ΠΏΠ°ΠΊΠ΅Ρ.
download β ΡΠΊΠ°ΡΠ°ΡΡ ΠΏΠ°ΠΊΠ΅Ρ ΠΈ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ (Π±Π΅Π· ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ).
uninstall β ΡΠ΄Π°Π»ΠΈΡΡ ΠΏΠ°ΠΊΠ΅Ρ.
list β Π²ΡΠ²Π΅ΡΡΠΈ ΡΠΏΠΈΡΠΎΠΊ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΡ
ΠΏΠ°ΠΊΠ΅ΡΠΎΠ².
show β ΠΏΠΎΠΊΠ°Π·Π°ΡΡ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΠΏΠ°ΠΊΠ΅ΡΠ΅.
search β ΠΏΠΎΠΈΡΠΊ ΠΏΠ°ΠΊΠ΅ΡΠ° (Π² ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ PyPI).
ΠΡΠΈΠΌΠ΅ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ PIP
Π Π°ΡΡΠΌΠΎΡΡΠΈΠΌ ΠΏΡΠΈΠΌΠ΅ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ PIP Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΠΏΠ°ΠΊΠ΅ΡΠ°ΠΌΠΈ.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΠ°ΠΊΠ΅ΡΠ°
ΠΠ»Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΡΠ²Π΅ΠΆΠ΅ΠΉ Π²Π΅ΡΡΠΈΠΈ ΠΏΠ°ΠΊΠ΅ΡΠ° Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌΠΎ Π²ΡΠΏΠΎΠ»Π½ΠΈΡΡ ΠΊΠΎΠΌΠ°Π½Π΄Ρ install:
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π½ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ ΠΏΠ°ΠΊΠ΅ΡΠ°
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π½ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ β ΡΠΊΠ°Π·ΡΠ²Π°Π΅ΡΡΡ ΠΈΠΌΡ ΠΏΠ°ΠΊΠ΅ΡΠ°, Π΄Π²Π° Π·Π½Π°ΠΊΠ° ΡΠ°Π²Π΅Π½ΡΡΠ²Π° ΠΈ ΡΡΠ΅Π±ΡΠ΅ΠΌΠ°Ρ Π²Π΅ΡΡΠΈΡ ΠΏΠ°ΠΊΠ΅ΡΠ°:
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΏΠ°ΠΊΠ΅ΡΠ° Π½Π΅ Π½ΠΈΠΆΠ΅ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π½ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ:
ΠΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΏΠ°ΠΊΠ΅ΡΠ°
ΠΠ±Π½ΠΎΠ²ΠΈΡΡ ΡΠΆΠ΅ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΠΉ ΠΏΠ°ΠΊΠ΅Ρ Π΄ΠΎ ΡΠ°ΠΌΠΎΠΉ ΡΠ²Π΅ΠΆΠ΅ΠΉ Π²Π΅ΡΡΠΈΠΈ:
Π‘ΠΏΠΈΡΠΎΠΊ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΡ ΠΏΠ°ΠΊΠ΅ΡΠΎΠ²
How to Install Pip on Ubuntu 18.04
Updated Feb 20, 2019
Pip is a package management system that simplifies installation and management of software packages written in Python such as those found in the Python Package Index (PyPI). Pip is not installed by default on Ubuntu 18.04, but the installation is pretty straightforward.
In this tutorial, we will show you how to install Python Pip on Ubuntu 18.04 using the apt package manager. We will also walk you through the basics of installing and managing Python packages with pip.
Prerequisites #
Installing pip for Python 3 #
Ubuntu 18.04 ships with Python 3, as the default Python installation. Complete the following steps to install pip ( pip3 ) for Python 3:
Start by updating the package list using the following command:
Use the following command to install pip for Python 3:
The command above will also install all the dependencies required for building Python modules.
Once the installation is complete, verify the installation by checking the pip version:
The version number may vary, but it will look something like this:
Installing pip for Python 2 #
Python 2 is not installed by default in Ubuntu 18.04. To install Python 2 and pip for Python 2, complete the following steps:
Update the package index by running the following command:
Install pip for Python 2 with:
The command above will install Python2, Pip and all the dependencies required for building Python modules.
Verify the installation by printing the pip version number:
The version number may vary, but it will look something like this:
How to Use Pip #
When installing python modules globally it is highly recommended to install distribution provided python modules using the apt package manager because they are tested to work properly on Ubuntu systems.
You should install Python modules globally using pip only if there is no package available through the package manager.
In most cases, you should use pip within a virtual environment only. Python Virtual Environments allows you to install Python modules in an isolated location for a specific project, rather than being installed globally. This way you do not have to worry about affecting other Python projects.
In this section, we show you a few useful basic pip commands. With pip, we can install packages from PyPI, version control, local projects, and from distribution files but in most cases, you will install packages from PyPI.
To view the list of all pip commands and options, type:
Installing Packages with Pip #
Letβs say you want to install a package called scrapy which is used for scraping and extracting data from websites.
To install the latest version of the package you need to run the following command:
To install a specific version of the package you would issue the following command:
Installing Packages with Pip using the Requirements Files #
requirement.txt is a text file that contains a list of pip packages with their versions that are required to run a specific Python project.
Use the following command to install a list of requirements specified in a file:
Listing Installed Packages #
To list all the installed pip packages use the command below:
Upgrade a Package With Pip #
To upgrade an installed package to the latest version, run:
Uninstalling Packages With Pip #
To uninstall a package run:
Conclusion #
In this tutorial, you have learned how to install pip on your Ubuntu machine and how to manage Python packages using pip. For more information about pip, visit the pip user guide page.
If you have any questions or feedback, feel free to comment below.