Check Pip Version
Pip offers a command-line interface for managing PyPi packages. In addition, it comes with an index of software packages for Python.
In recent versions of the Python interpreter, pip is packaged by default, and you may not need to install it.
However, you may need to install pip manually in older versions, especially if you face the “pip command not found” error.
Install Pip on Linux – Package Manager
Follow along with the steps provided below to install pip on Linux:
Debian Based Distro
On Debian based distribution, run:
$ sudo apt-get update
$ sudo apt-get install python3-pip
Once completed, verify pip is working by running the command:
pip 22.0.2 from /usr/lib/python3/dist-packages/pip ( python 3.10 )
REHL
On REHL systems, run:
$ sudo yum update
$ sudo yum install python3-pip
Verify that pip is installed by running the command:
Manjaro/Arch
On Arch-based distributions, run the command:
$ sudo pacman -S python-pip
Install Pip on Windows
Open your terminal window and download the get-pip.py installer file to install pip on windows.
Download the file with curl as:
Once downloaded, run the file with Python:
Once completed, run the command below to check the installed pip version.
The next step is to add pip to the path environment variable. This allows you to access the pip command from any directory in your system.
Run the command prompt as administrator and execute the command:
Upgrading and Downgrading Pip
You can update pip by invoking pip as a python module as shown in the command below:
The command above should update your pip version to the latest release.
To downgrade to a specific version of pip, use the command:
For example, to install pip version 21.0, run:
Pip Install Package
Once you have pip installed, you can use it to install specific packages. The syntax is as shown:
For example, to install pandas with pip:
Pandas Uninstall Package
To uninstall a package with pandas:
Pip Show Installed Packages
To show the installed packages in your environment, run the pip list command:
Pip Get Package Information
To get information about an installed package with pip, use the command:
You should get detailed information about the package, including the installed version, location, requirements, etc.
Conclusion
This tutorial helped you learn how to install pip on Windows and Linux, update and downgrade pip, install and uninstall packages, and get package information using pip.
About the author
John Otieno
My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list
How To Check Which PIP Version Is Installed On Your System
If you are coding in Python, you are probably using PIP to manage your Python packages easily and import them into your projects. Keeping Python and PIP up-to-date is important to avoid issues in your applications, so in this article, I will explain how to check the current PIP version, and update it if needed.
You can get the current PIP version on your system by opening a terminal and typing the command: pip -V. It will show the PIP version and the Python version that is installed on the computer (if any).
Let’s take a more detailed look at how to do this with each operating system, and I’ll also give you more tips to install and keep your system up-to-date.
By the way, if you get overwhelmed as soon as Python is required for a project, I recommend checking out my e-book “Master Python on Raspberry Pi“. It will guide you step-by-step to learn the essential concepts (and only the essential concepts) required to achieve any project in the future. Raspberry Pi without Python is like a car without an engine, you miss all the fun parts. Get 10% off by downloading it today!
How to know the version of PIP installed on your system?
Linux
On Linux distributions, you can check the installed PIP version with the command:
pip -V
or
pip —version
Open the terminal, and type the command.
If PIP is installed properly, you should get something like:
The first version number corresponds to the current PIP version installed (22.0.2 in my example).
You can also find the Python version you are using near the end of the line (3.10 on my screenshot).
If you get an error, it’s probably because PIP is not installed yet.
Use the apt command they give you to install it or check the end of this article for more detail on how to install PIP on any system.
Note: If you have several Python versions installed on your system, using “pip3 -V” instead of “pip -V” might give a different result. In this case, you should also use “pip3” when installing new packages, or they will be installed for Python 2.
macOS
The process is the same on macOS. Open a terminal and use the same command to check the current PIP version:
pip —version
or:
pip3 —version
If you have Python 2 and 3 installed.
Windows
On Windows, the process is slightly different, but you can quickly know the current PIP version by following these steps:
- Open the command prompt.
Use the search engine in the start menu to quickly find it. - Then type this command:
py -m pip —version - If everything is set up correctly, you should get something like:
If it doesn’t work, check the end of this article to install PIP on Windows (and maybe Python too).
What is the latest PIP version available?
The easiest way to know the latest PIP version available is to go to the PIP project page on PyPi and check the version number at the top.
There will almost always be a slight difference between the latest version available on this website, and the one installed on your system. As for any application, it’s often better to use a recent version but not the latest one that could include various bugs and create problems in your project.
If you are on a test environment and absolutely want to install this version, you can upgrade it by using these commands:
- On Linux / macOS:
sudo pip install pip —upgrade - On Windows:
py -m pip install pip —upgrade
This should download and install the same version as stated on the PyPi website.
If you are looking for exclusive tutorials, I post a new course each month, available for premium members only. Join the community to get access to all of them right now!
How to install the latest PIP version for your system?
Linux
The easiest way to install PIP on a Linux distribution is to use the package manager.
So, on Ubuntu and Debian-like systems, you can install PIP with:
sudo apt install python3-pip
On other Linux distributions, you’ll find something similar, for example:
- Fedora:
sudo dnf install python3-pip - CentOS:
sudo yum install python3-pip - Arch Linux:
sudo pacman -S python3-pip - OpenSUSE:
sudo zypper install python3-pip
In the official PIP documentation, they also give two other methods if you prefer:
- You can either use the “ensurepip” module to install PIP as a requirement for your Python environment:
python -m ensurepip —upgrade - Or download a Python script that will install it for you:
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
Are you a bit lost in the Linux command line? Check this article first for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.
macOS
On macOS, you can follow the same last two solutions I gave for Linux distributions, which are:
- Either using the “ensurepip” module to install PIP on your Mac:
python -m ensurepip —upgrade - Or download and run this Python script:
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
Either way, don’t forget to use the “–upgrade” parameter if you need the latest version:
python -m pip install —upgrade pip
Windows
Make sure you have Python installed
Linux distributions often include Python by default, but it’s not the case on Windows.
So, before going any further, make sure Python is installed on your system:
- Open a command prompt:
Open the start menu, and type “command” or “cmd” to find the application. - Once in the black terminal, type the command:
py —version - It should give you something like:
If the command is not recognized, then you need to install Python first, and then PIP.
Check the following parts to do this on your computer.
Install Python first
To install Python on Windows, go to this page on the official Python website.
Download the Windows Installer for your system (32 or 64-bit):
Once downloaded, double-click on the first and click on “Install now” to install Python on your Windows system:
A few seconds later, everything is ready to use, we just need to install PIP on top of it.
Install the latest PIP version on Windows
- Open a command prompt (find the app in the start menu).
- Type the following command:
py -m ensurepip —default-pip - It will install PIP and the other requirements if needed:
- You can then check that PIP is installed properly with:
py -m pip —version - And if you absolutely need the latest version, you can upgrade it with:
py -m pip install pip —upgrade
But as explained previously, this is not necessarily a good idea in a production environment.
Additional Resources
Lost with the command line?
You don’t need to learn and remember everything, just download my cheat sheet where I explain the most important commands on Linux, with a brief explanation and some examples.
Download my free PDF cheat sheet.
VIP Community
If you just want to hang out with me and other Linux fans, you can also join the community. I share exclusive tutorials and behind-the-scenes content there. Premium members can also visit the website without ads.
More details here.
Need help building something with Python?
Python is a great language to get started with programming on any Linux computer.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.
Как обновить PIP в Windows
Зачастую возникает необходимость обновления PIP. В данном руководстве будет дана поэтапная инструкция для обновления PIP в Windows.
Содержание статьи
Столкнуться с необходимостью обновления PIP можно при установке любого пакета, используя PIP.
Выводится следующее сообщение:
Вы используете версию pip 19.3.1; однако, доступна версия 20.1.1. Вам стоит сделать обновление через команду ‘python -m pip install –upgrade pip’.
Есть вопросы по Python?
На нашем форуме вы можете задать любой вопрос и получить ответ от всего нашего сообщества!
Telegram Чат & Канал
Вступите в наш дружный чат по Python и начните общение с единомышленниками! Станьте частью большого сообщества!
Паблик VK
Одно из самых больших сообществ по Python в социальной сети ВК. Видео уроки и книги для вас!
Для обновления PIP в Windows нужно открыть Windows Command Prompt, а затем набрать/скопировать туда указанную команду. Обратите внимание, что данный метод сработает только если у вас уже добавлен Python в Windows PATH. Ничего страшного, если вы не знаете, что это такое. Далее мы подробно разберем все шаги обновления PIP.
План обновления PIP в Windows
В поисковике Windows наберите Command Prompt (Командная строка):
Затем откройте Command Prompt (Командную строку). Во избежание проблем с уровнем доступа сделайте это от имени администратора. Для этого кликлинте правой кнопкой мыши и выберите пункт Run as administrator (Запустить от имени администратора):
В командной строке наберите cd \ , чтобы удостовериться, что в начальной точке только название диска:
Нажмите Enter. Вы увидите название диска C:\>
Найдите путь к Python, что является папкой, куда установлен Python.
В нашем случае путь приложения Python следующий:
После получения пути к Python наберите следующую команду в командной строке: cd , за которым следует путь к приложению Python.
В нашем случае это выглядит следующим образом:
Нажмите Enter, вы увидите:
Обновите PIP, использовав данную команду, затем нажмите Enter:
Система управления пакетами pip#
Для установки пакетов Python будет использоваться pip. Это система управления пакетами, которая используется для установки пакетов из Python Package Index (PyPI). Скорее всего, если у вас уже установлен Python, то установлен и pip.
Проверка версии pip:
Если команда выдала ошибку, значит, pip не установлен. Установка pip описана в документации
Установка модулей#
Для установки модулей используется команда pip install :
Удаление пакета выполняется таким образом:
Кроме того, иногда необходимо обновить пакет:
pip или pip3#
В зависимости от того, как установлен и настроен Python в системе, может потребоваться использовать pip3 вместо pip. Чтобы проверить, какой вариант используется, надо выполнить команду pip —version .
Вариант, когда pip соответствует Python 2.7:
Вариант, когда pip3 соответствует Python 3.7:
Если в системе используется pip3, то каждый раз, когда в книге устанавливается модуль Python, нужно будет заменить pip на pip3.
Также можно использовать альтернативный вариант вызова pip:
Таким образом, всегда понятно для какой именно версии Python устанавливается пакет.