- Как обновить PIP в Windows
- Содержание статьи
- План обновления PIP в Windows
- Проверка текущей версии PIP
- Инструмент для обновления PIP в Windows
- Как вернуться к предыдущей версии PIP
- How To Upgrade Pip In Mac | Update Pip On Windows and Linux
- Python and OS Compatibility
- Python in the older version of Mac
- How to Install Python 3.8 using Homebrew on Mac
- Steps to upgrade Pip in Mac
- Upgrading pip on Linux
- Upgrading pip on Windows
- Conclusion
- any idea how to update python PIP on a windows box?
- 6 Answers 6
- How to Upgrade PIP in Windows
- Steps to upgrade PIP in Windows
- Steps to check the version of PIP
- Simple tool to upgrade PIP in Windows
- Steps to downgrade PIP to a previous version
- Final Words
Как обновить 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:
Проверка текущей версии PIP
Для проверки текущей версии PIP нужно использовать путь скриптов Python вместо пути приложения.
Наберите cd\ , чтобы убедиться, что стартовой точкой является только название диска:
Затем найдите путь к Python скриптов. Папка скриптов должна находиться внутри пути приложения Pythоn.
В нашем случае путь Python скриптов следующий:
Затем наберите cd , после которой следует путь к Python скриптам, и нажмите Enter.
В конечном итоге наберите следующую команду для проверки версии PIP:
Нажмите Enter, после этого будет показана версия PIP.
Инструмент для обновления PIP в Windows
Разберем простой инструмент для обновления PIP.
Обратите внимание, что вам нужно добавить Python к Windows PATH для использования данного инструмента.
Далее дан полный код Python для инструмента обновления PIP используя Tkinter:
Просто запустите код и затем нажмите на кнопку Upgrade PIP, после чего команда выполнится.
Что, если нужно откатиться к предыдущей версии PIP?
Выполнив следующие шаги, вернуться к предыдущей версии PIP не составит особого труда.
Как вернуться к предыдущей версии PIP
Перейдите в папку где установлен Python. Если сейчас настроен путь к скриптам, тогда просто наберите cd .. (и затем нажмите Enter), и вы вернетесь к папке с установленным Python.
Предположим, нам нужно вернуться к версии 18.1.
Для этого просто наберите следующую команду и затем нажмите Enter:
Вы должны увидеть указанную версию PIP:
Являюсь администратором нескольких порталов по обучению языков программирования Python, Golang и Kotlin. В составе небольшой команды единомышленников, мы занимаемся популяризацией языков программирования на русскоязычную аудиторию. Большая часть статей была адаптирована нами на русский язык и распространяется бесплатно.
E-mail: vasile.buldumac@ati.utm.md
Образование
Universitatea Tehnică a Moldovei (utm.md)
- 2014 — 2018 Технический Университет Молдовы, ИТ-Инженер. Тема дипломной работы «Автоматизация покупки и продажи криптовалюты используя технический анализ»
- 2018 — 2020 Технический Университет Молдовы, Магистр, Магистерская диссертация «Идентификация человека в киберпространстве по фотографии лица»
How To Upgrade Pip In Mac | Update Pip On Windows and Linux
Pip is a default standard package-manager used to install and manage software packages written in Python. Many packages can be found in the default source for packages and their dependencies, which is called the Python Package Index.
Most distributions of Python come with pip preinstalled. Upgrading pip in windows, Mac, or Linux is an important step, and we have to update time to time to get the latest updates.
Python and OS Compatibility
Python pip works with CPython versions 2.7, 3.5, 3.6, 3.7, 3.8, and also PyPy. This meaning is that pip works on the latest patch version of each of these minor versions. Previous patch versions are supported on a best-effort approach.
The pip works on Unix/Linux, macOS, and Windows.
Python in the older version of Mac
Python is the most popular programming language on the earth right now, and beginners and experienced developers alike widely use it.
Modern Mac OS versions come with Python 2.7.x installed (or Python 2.6.1 if an older Mac OS X version), but many Python users may need to update Python in Mac OS to the newer version like Python 3.8.x or newer.
Note that we said install Python 3, not update to Python 3, because how this will work is installing Python 3 while simultaneously maintaining the Python 2 version on the Mac.
This is important because, apparently, some Mac apps rely on Python 2 version, so if you attempt to upgrade the Python 2.x to Python 3.x on Mac OS, you will eventually break some apps, perhaps critical apps.
With that in mind, you should not attempt to upgrade the current preinstalled Python release on the Mac; instead, you will just have the co-installation of Python 3 for full compatibility.
How to Install Python 3.8 using Homebrew on Mac
Installing the updated version of Python 3 is super easy with HomeBrew.
Of course, you will have to install Homebrew on the Mac before you can use the Homebrew method. Still, if you’re interested in messing around with Python, then Homebrew will probably appeal to you anyway.
To install the latest version of Python 3 with Homebrew, type the following command.
Once the updated Python 3 has been installed on your Mac, you can run the following command.
You can check python 2 and python 3’s version simultaneously.
Now, if you already have Python but do not have upgraded pip on your Mac, then see the following steps.
Steps to upgrade Pip in Mac
Mac OS X latest version with Python version 3, then pip is already installed.
If you are using Python 2.x or Python 3.x downloaded from python.org or if you are working in the Virtual Environment created by virtualenv or pyvenv . Please make sure to upgrade pip .
Still, If pip is not installed or upgraded in your machine, you can use the following steps one by one.
Type the following command one by one.
My current Pip version is the following.
Upgrading pip on Linux
First, check the version of Python.
Now, if your version is old, then you can upgrade pip on Linux using the following command.
The above command will update your pip version.
Upgrading pip on Windows
To upgrade PIP in Windows, you will have to open the Windows Command Prompt(CMD), and then type the command below.
Note that the following way would only work if you already added the Python to your Windows path.
If you have the older version of pip, then you can upgrade pip on windows using the following command.
Conclusion
Upgrade Pip on Windows, Mac, or Linux can be easy, but due to multiple versions of Python running on a machine, sometimes it becomes troublesome.
In this tutorial, we have seen how we can upgrade pip and Python on Mac as well as Windows and Linux.
any idea how to update python PIP on a windows box?
pip install —upgrade pip doesn’t work because the windows FS is brain damaged and won’t let you delete an open file.
I’ve tried setting my environment to the virtualenv that I want to update and then running from a different pip, but that fails with:
I’m hoping someone else has figured out a way around this. Its no problem on linux.
6 Answers 6
easy_install -U pip
Run pip as a script, using python as the main executable.
[UPDATE 2015-11-15] This post is obsolete and out of date. Current best practice is according to pip is to use the following:
It’s not necessary to use easy_install from setuptools. The recommended procedure to update pip, from the pip-installer page is to use get-pip.py .
To install or upgrade pip, securely download get-pip.py .
You can use the following in a Bash shell like msysgit’s Git Bash.
Use the -L option to follow redirects. Recently GitHub changed the url for raw content, so the old raw get-pip.py url has been redirected and on the pip website the url was changed. If successful, you should see the following:
You can modify this for the Windows command line, but first if you don’t have libcurl, download a Windows binary from Curl. You’ll want to scroll all the way to the bottom and get Günter Knauf’s current official Win32 binary (currently 7.29) and unzip it. Don’t worry about it being 32-bit versus 64-bit. Just make sure you get the one with all the bells and whistles (ssl, zlib, etc.). Now navigate to the folder where you downloaded curl, probably c:\Users\ \Downloads , open the extracted folder, probably curl-7.29.0-rtmp-ssh2-ssl-sspi-zlib-idn-static-bin-w32 , and you should find curl.exe . Yay! Now in a windows shell type this after the prompt (which will have your username instead of myusername ), replacing path\to\Curl\ with the path to the downloaded curl.exe file.
You need the -k option to allow curl to access the secure GitHub pip site without certs. Also, thanks Piotr Dobrogost for telling me about Windows pipes, | , which saves the step of saving the file.
If you already have the latest version of pip you will get the following message:
How to Upgrade PIP in Windows
In this short tutorial, you’ll see the steps to upgrade PIP in Windows from scratch.
Here are the topics to be reviewed:
- Upgrade PIP in Windows
- Check the version of PIP
- Simple tool to upgrade PIP
- Downgrade PIP to a previous version
In general, you may consider to upgrade PIP if you get a notification similar to the following:
You are using pip version 19.2.3, however version 20.2.2 is available. You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.
In order to upgrade PIP in Windows, you’ll need to open the Windows Command Prompt, and then type/copy the command below. Note that the following method would only work if you already added Python to Windows path. Don’t worry if you don’t know what it means, as I’ll show you the full steps to upgrade pip in windows in the next section.
Steps to upgrade PIP in Windows
(1) First, type Command Prompt in the Windows search box:
(2) Next, open the Command Prompt (to avoid any permission issues, you may consider to run the Command Prompt as an administrator . You can do so, by Right clicking on the Command Prompt, and then selecting Run as administrator):
(3) In the Command Prompt, type “cd\” to ensure that your starting point has only the drive name:
(4) Press Enter, and you’ll see the drive name C:\>
(5) Locate your Python application path, which is the folder where you originally installed Python.
In my case, the Python application path is:
C:\Users\Ron\AppData\Local\Programs\Python\Python37-32
Once you retrieved the Python application path, type the following command in the Command Prompt:
“cd” followed by your Python application path
In my case, I typed:
(6) Press Enter, and you’ll see:
(7) To upgrade PIP, type/copy this command, and then press Enter:
This is how the command would look like in the Command Prompt:
(8) You’ll notice that the latest version of PIP will be installed:
Steps to check the version of PIP
To check the version of PIP at any time, you’ll need to use the Python Scripts path, rather than the Python application path.
(1) First, type “cd\” to ensure that your starting point has only the drive name:
(2) Then, locate your Python Scripts path. The Scripts folder should be located within the Python application path.
In my case, the Python Scripts path is:
C:\Users\Ron\AppData\Local\Programs\Python\Python37-32\Scripts
(3) Type “cd” followed by the Python Scripts path (then press Enter):
(4) Finally, type the following command to check the version of PIP:
(5) Press Enter, and you’ll see the PIP version:
Simple tool to upgrade PIP in Windows
In this section of the tutorial, I’ll share with you the code to upgrade PIP using a simple tool I created.
Note that you’ll need to add Python to Windows path in order to start using the tool.
Here is the complete Python code:
Simply run the code, and then press on the button ‘Upgrade PIP’ and you should be good to go.
Now, what if you’d like to revert back to a previous version of PIP?
You can easily downgrade to a previous version of PIP by following the steps below.
Steps to downgrade PIP to a previous version
(1) Get to the Python application path. If you are currently set to the Python Scripts path, you can simply type “cd..” (and then press Enter), and you would revert back to the Python application path:
(2) Let’s say that you want to downgrade the PIP version to 18.1
To do that, simply type the following command, and then press Enter:
(3) You should now see the version of PIP that you specified:
Final Words
If you’re using Anaconda, you may want to check this tutorial that explains how to upgrade PIP in Anaconda.
Finally, if you need to install PIP, you may wanna review the pip documentation.