Как обновить версию питона windows

In this article, we are going to see how to update Python in the Windows system. For the sake of example, we will be upgrading from Python 3.6.8 to Python 3.9.6.

To check the current version of python on your system, use the following command in the command prompt:

python -V

This will show you your current python version as shown below:

Using the executable installer:

Follow the below steps to update your python version:

Step 1: Go to Python’s official site.

Step 2: Click on the Downloads tab.

Here you will get a list of available releases.

Step 3: Download the version you need to upgrade to based on your system specifications(ie, 32-bit or 64-bit). Here we will be downloading the 64-bit installer for 3.9.6.

Step 4: Click on the installer and it will begin the installation. Make sure to select the “Add Python 3.9 to PATH” option. and click on “Install Now”.

This will start the installation as shown below:

After the installation is successful you will get the following message:

Now if you open up your cmd and use the below command:

python -V

You’ll see your version of Python has been updated to 3.9.6 as shown below:

Last Updated :
31 Aug, 2021

Like Article

Save Article

Как обновить Python в Windows?

На чтение 2 мин Просмотров 60.4к. Опубликовано

Подробно рассмотрим как правильно обновить язык программирования Python.

Содержание

  1. Введение
  2. Узнаем текущую версию
  3. Скачиваем последнюю версию
  4. Установка
  5. Проверка установки
  6. Заключение

Введение

Технологии развиваются быстро, а языки программирования — это основной драйвер развития. Нередко выходят корректирующие релизы исправляющие найденные ошибки или версии с расширением функционала. Python в этом плане ничем не отличается от других языков программирования, но процесс его обновления не столь сложен, как может показаться сначала. Если у вас получится обновить один раз, вы уже не забудете как его повторить, потому что это не сложно и очень быстро. 

Узнаем текущую версию

Открываем пуск -> выполнить -> вводим команду cmd. В открывшемся окне пишем команду python —version и смотрим какая у нас версия.

Командная строка Windows
Командная строка Windows

Скачиваем последнюю версию

Переходим на официальный сайт www.python.org/downloads/ и скачиваем последнюю версию

Раздел загрузок официального сайта Python.org
Раздел загрузок официального сайта Python.org

Нажимаем кнопочку Download Python и скачиваем дистрибутив

Загрузка последней версии Python с помощью браузера Edge
Загрузка последней версии Python с помощью браузера Edge

Установка

Так как у меня установлена уже последняя версия Python мне пришлось скачать beta версию для демонстрации процесса обновления. Не пугайтесь из за того, что на картинках другая версия, это не ошибка 🙂

Запуск установочного пакета Python 3.9
Запуск установочного пакета Python 3.9

Ставим обязательно галочку перед пунктом Add Python 3.9 to PATH.

Нажимаем Install Now и переходим далее.

Обязательно предоставляем полные права приложению

Запрос прав администратора для установки Python
Запрос прав администратора для установки Python

Дожидаемся окончания процесса установки и в конце нажимаем Close

Завершение установки Python для Windows
Завершение установки Python для Windows

Проверка установки

В самом начале я описал процесс сверки текущий версии Python. Нам сейчас это необходимо повторить, только предварительно перезапустив окно cmd.exe иначе запуститься python старой версии 🙂

Заключение

В этой статье мы рассмотрели процесс обновления языка программирования Python, прошли от первого до последнего шага и успешно завершили обновление.

На это все. Поздравляю, теперь у вас установлена последняя версия Python.

Егор Егоров

Программирую на Python с 2017 года. Люблю создавать контент, который помогает людям понять сложные вещи. Не представляю жизнь без непрерывного цикла обучения, спорта и чувства юмора.

Ссылка на мой github есть в шапке. Залетай.

Python — это универсальный язык программирования, широко используемый в различных областях разработки ПО. Обновление Python до последней версии имеет ряд преимуществ, таких как улучшение производительности и исправление ошибок. Если вы используете Windows и хотите обновить Python, вам необходимо выполнить несколько простых шагов через командную строку.

Прежде чем начать, убедитесь, что у вас установлена Python. Вы можете проверить, установлена ли Python на вашем компьютере, открыв командную строку и запустив команду python —version. Если Python установлен, вы увидите версию, которая установлена на вашем компьютере. Если Python не установлен, вам необходимо скачать и установить его с официального сайта Python.

Когда вы убедились, что Python установлен на вашем компьютере, вы можете приступить к обновлению. Сначала откройте командную строку, нажав клавиши Windows + R и введя «cmd». Выполните команду python -m pip install —upgrade pip для обновления инструмента установки пакетов Python — pip. Это необходимо для того, чтобы вы могли обновить сам Python и его пакеты.

Примечание: если у вас установлена версия Python 2.x, вместо команды «pip» вы должны использовать «pip2», чтобы обновить pip для Python 2.x.

Содержание

  1. Подробная инструкция по обновлению Python в Windows через консоль
  2. Шаг 1: Установка pip
  3. Шаг 2: Проверка версии Python
  4. Шаг 3: Обновление Python
  5. Шаг 4: Проверка обновления
  6. Проверка текущей версии Python
  7. Подготовка к обновлению
  8. Удаление старой версии Python
  9. Установка новой версии Python

Подробная инструкция по обновлению Python в Windows через консоль

Если вы являетесь пользователем Windows и у вас уже установлен Python, вам могут потребоваться обновления программы. Обновление важно, так как новые версии Python содержат исправления ошибок, улучшения и новые возможности. В этой статье мы расскажем, как обновить Python в Windows через консоль.

Шаг 1: Установка pip

Перед обновлением Python вам необходимо убедиться, что у вас установлен инструмент pip. Pip – это стандартный менеджер пакетов для Python, который позволяет устанавливать и обновлять дополнительные пакеты и библиотеки.

Для проверки наличия pip введите следующую команду в командной строке Windows:

pip --version

Если команда не найдена, вам необходимо установить pip. Скачайте файл get-pip.py по ссылке https://bootstrap.pypa.io/get-pip.py. Затем запустите командную строку Windows и перейдите в папку, где сохранен файл get-pip.py. Выполните следующую команду для установки pip:

python get-pip.py

Шаг 2: Проверка версии Python

Прежде чем обновлять Python, вам нужно узнать текущую версию Python на вашем компьютере. В командной строке введите следующую команду:

python --version

Вы увидите номер версии Python, установленный на вашем компьютере. Если версия Python начинается с 2, то для обновления вам нужно загрузить и установить Python 3.

Шаг 3: Обновление Python

Теперь, когда у вас установлен pip и вы знаете текущую версию Python, вы можете приступить к обновлению.

Введите следующую команду в командной строке, чтобы обновить Python:

pip install --upgrade python

Команда pip install —upgrade python устанавливает последнюю версию Python.

По окончании обновления вы увидите сообщение о успешной установке новой версии Python.

Шаг 4: Проверка обновления

После обновления проверьте, что Python успешно обновлен. Введите следующую команду в командной строке:

python --version

Выведенное сообщение должно отображать новый номер версии Python, который вы только что установили.

Теперь вы успешно обновили Python в Windows через консоль. Если у вас возникли проблемы или ошибки, убедитесь, что вы следовали инструкциям правильно или обратитесь за помощью к специалисту.

Проверка текущей версии Python

Прежде чем обновлять Python в Windows, важно убедиться, какая версия у вас установлена. Для этого вы можете воспользоваться командной строкой.

Шаги по проверке версии Python:

1. Откройте командную строку, нажав клавишу Win + R и введите cmd.
2. После открытия командной строки введите следующую команду:
python --version
3. Нажмите клавишу Enter. В результате будет отображена версия Python, установленная на вашем компьютере.

Подготовка к обновлению

Перед тем, как обновить Python на компьютере с Windows, необходимо выполнить некоторые предварительные шаги:

  1. Сделайте резервную копию данных. В случае возникновения проблем во время обновления, резервная копия позволит восстановить систему.
  2. Убедитесь, что у вас есть права администратора. Для выполнения некоторых команд в консоли потребуется права администратора.
  3. Закройте все программы, связанные с Python. Прежде чем обновлять Python, убедитесь, что все программы, связанные с ним, закрыты, чтобы избежать возможных конфликтов.
  4. Проверьте текущую версию Python. Вы можете узнать текущую версию Python, выполнив команду python --version или python3 --version в командной строке.
  5. Подготовьте установочный файл Python. Скачайте установочный файл Python с официального сайта https://www.python.org/downloads/ в соответствии с требуемой версией.

После выполнения этих предварительных шагов вы будете готовы к обновлению Python на компьютере с Windows.

Удаление старой версии Python

Перед установкой новой версии Python на компьютере необходимо удалить старую версию. Для этого следуйте инструкциям:

  1. Откройте меню «Пуск» и выберите «Панель управления».
  2. В «Панели управления» найдите раздел «Программы» и выберите «Удаление программ».
  3. В списке установленных программ найдите Python и щелкните по нему правой кнопкой мыши.
  4. Выберите «Удалить» из контекстного меню.
  5. Следуйте инструкциям мастера удаления для завершения процесса удаления старой версии Python.
Процесс удаления Python через «Панель управления»

Шаг Действие
1 Откройте меню «Пуск» и выберите «Панель управления».
2 В «Панели управления» найдите раздел «Программы» и выберите «Удаление программ».
3 В списке установленных программ найдите Python и щелкните по нему правой кнопкой мыши.
4 Выберите «Удалить» из контекстного меню.
5 Следуйте инструкциям мастера удаления для завершения процесса удаления старой версии Python.

После успешного удаления старой версии Python вы можете приступить к установке новой версии, следуя дальнейшим инструкциям.

Установка новой версии Python

Если вы хотите установить новую версию Python на своем компьютере, следуйте этим шагам:

  1. Перейдите на официальный веб-сайт Python (https://www.python.org/downloads/)
  2. Выберите последнюю стабильную версию Python для Windows и нажмите на ссылку для скачивания.
  3. Запустите загруженный установщик Python.
  4. На первом экране установщика убедитесь, что выбраны опции «Add Python to PATH» и «Customize installation».
  5. На экране «Optional Features» выберите опции, которые вам нужны. Убедитесь, что выбраны все дополнительные модули и библиотеки, которые вы используете в своих проектах.
  6. На экране «Advanced Options» удостоверьтесь, что путь к установке Python на вашем компьютере указан правильно. Обычно рекомендуется использовать стандартное место установки.
  7. После того, как вы пройдете все экраны установщика, нажмите «Install» для начала установки новой версии Python.
  8. Подождите, пока установщик завершит процесс установки. Это может занять некоторое время, так что будьте терпеливы.
  9. После завершения установки вы увидите окно с информацией о том, что установка Python была успешно завершена.
  10. Теперь вы можете проверить, что новая версия Python установлена, открыв командную строку (cmd) и запустив команду python --version.

Поздравляю! Теперь у вас установлена новая версия Python на вашем компьютере.

»


This article is part of in the series

Published: Friday 23rd July 2021

Last Updated: Saturday 17th December 2022

Python receives a major update once every 12 months, with bug-fix updates and security patches being released every few months. The most recent version of Python – Python 3.9 – introduces features like Union Operators in dict, the Flexible function, and Type Hinting Generics.  Updating Python can be confusing regardless of which OS you’re running. Do you remove the old version first? Or can you update the package directly? Here’s an easy tutorial on how to update Python.

How to Update Python in Linux, Mac, or Windows

It is possible to install two major versions of Python – say, Python 2.x and Python 3.x – on one computer and use both. If you want to move from Python 2.x to 3.x, you don’t have to uninstall the previous version unless you don’t want to use it anymore. Furthermore, Python 3 now comes with the “py.exe” launcher integrated by default. The launcher helps users in two ways: 

  1. Users can run Python from any shell using the command “py.” Typing “python” is no longer required.
  2. Allows you to use two different versions of Python 3 at the same time. You can specify which version of Python you want to use to run code with simple switches in commands (like “py -3.6”).

In other words, you won’t need to change the PATH variable every time you want to use another version of Python. But the launcher only comes installed on the Windows version of Python 3. Updating Python in computers with Linux or macOS can be more complicated.

Note: If you’ve not installed Python on your computer yet, you cannot update to a newer version. If you’re having trouble installing Python on your computer, reading our Python installation guide will help.

Updating Python in Linux

Before you run any commands, you can save yourself a lot of effort by checking whether the Linux installation comes with the latest version of Python installed. To check what version of Python 3 your machine has, open the Terminal by pressing Ctrl+Alt +T, and type in the following command:             python3 –version Or alternatively:             python3 -V The output should look something like this: command python3 -V on terminal to check python version If you see that your machine doesn’t have Python 3.9, you must run the following commands:              sudo apt update              sudo apt install software-properties-common These commands will install the Python packages required to install the newest Python version. You can now install the latest version of Python in two ways: using Apt and using the source code. Using Apt to update Python is faster and easier. Here’s how you do it:

Updating Python Using Apt-Get

Using the Apt package manager is the easiest method of installing Python 3.9 on Linux. First, you must configure the deadsnakes PPA to your machine by running the following command:             sudo add-apt-repository ppa:deadsnakes/ppa  You can now update the apt cache and install the Python 3.9 package:             sudo apt update              sudo apt install python3.9 The Python update will install. However, by default, Python will point to the previously installed version of Python 3.  After installation completes, you must update Python 3 to point to Python 3.9. Enter this command to configure Python 3:             sudo update-alternatives —config python3 A list of options will appear, and you will be prompted to pick which version of Python you want Python 3 to point to. The prompt should look like this: command to configure Python 3: sudo update-alternatives --config python3 All you have to do is type the right selection number, and you will have updated Python to the newest version on your Linux machine. To verify the version of Python being used, you can run:             python3 —V

Updating Python in Mac

Updating Python on a machine with macOS is a lot easier than updating it on a Linux machine. A Mac can have more than one version of Python installed. Therefore, you can update Python by visiting https://www.python.org/downloads/mac-osx/, downloading the installer, and running it. If you have Homebrew installed on your Mac, you can run the following command on the Terminal:             brew install python After the process completes, your computer will have the latest version of Python 3. You can verify this by running the command:             python3 —version If you want to upgrade pip and add a new library to it, you can enter the following command:             pip3 install <PROJECT NAME>

Updating Python in Windows

Updating to a new Python version is easy on a computer running Windows. All you have to do is visit the Python downloads page and download the latest version. If you’re updating to a new patch of Python (3.x.a to 3.x.b), when you run the installer, it will prompt you to “Upgrade Now.” The installer will look like this: Upgrade to Python 3.7.4 prompt window Clicking on the button will replace the existing version of Python with the new version. The older version will be removed from your computer. After you restart the computer, the new patch will be installed on your machine. In contrast, if you’re updating Python to a new minor version (3.x to 3.y), you will see the “Install Now” prompt instead of the “Upgrade Now” prompt on the installer. Clicking the button will install the new version of Python. However, the old version will not be removed. Your computer can have more than one Python version installed. The py launcher is installed automatically regardless of the version of Python you’re using. It will enable you to select the version of Python you want to use.  Running a program with a specific version is as simple as using the “py” command and entering the version you want to use, like so:             py -3.8 or              py -3.9 Suppose there are many projects on your machine that use the previous version of Python, and you use them all in a virtual environment. In that case, you can update Python just in that environment using the following command:             python -m venv —upgrade <VIRTUAL ENVIRONMENT PATH HERE>

Conclusion

Every version of Python, including the newest release, has some limitations. However, updating to the latest version of Python allows you to use all the new features. Furthermore, updated versions also come with bug fixes and improved security measures. With this guide handy, you should be able to get your hands on the newest Python version in a matter of minutes. Going through our Python usage guide next will help you quickly pick up all that you can do with Python.

  1. Home
  2. Python Tips and Tricks
  3. Python Library Tutorials
  4. Python How To’s
  5. Python Tutorials

Python is a programming language widely used for building various applications like web development, machine learning, data science, automation, and many more.

Every 12 months, Python receives a major update with improved security and bug fixes. So you might want to update the Python version to stay compatible with the latest technologies.

In this blog, we will discuss ways you can update Python on Windows, Linux, and Mac.

So let’s get started.


Update Python on Windows

The first thing you need to do is check the Python version you are currently using. To check, run the following command on the command prompt.

python -V
Command to check Python version on Windows 
Check Python version on Windows command prompt

This will display the current version of Python on your computer.

If your computer does not have Python, the above command will give the error «Python was not found». To install Python, visit the guide How to install Python.

While there are multiple ways to update Python, using Python Installer is the most convenient option. Here are the steps involved:

1. Select the Python version you want to update to

2. Download the Python installer and run it

3. Verify Python update

Let’s explore these installation steps further.


Step 1: Select Python Version to Update

Go to Python’s official website and scan the available Python versions.

I currently have Python 3.10.9. Now I want to update Python to the latest version Python 3.11.1. You select the one you want to upgrade Python to.


Step 2: Download the Python installer and Run It

Download the Python installer of the selected version.

If you have a 64-bit Operating System, it won’t matter which version you install. But for older 32-bit Operating Systems, ensure you install the 32-bit version of Python.

List of Python installers on Python official website

Once it’s installed, run the installer. You will see a setup wizard like this:

Setup Wizard

Make sure you select the Add python.exe to PATH.

Note: You can install two Python versions at the same time. For example, Python 2.x and 3.x. This is why we seen an ‘Install Now’ button instead of ‘Update now.’

If you are upgrading from Python 2.x.x to 2.x.y,  you are actually replacing 2.x.x with 2.x.y.

Back to installation, click the Install Now button. It will start the Python installation.

Setup Progress

After some basic steps, Python will be installed on your Windows.


Step 3: Verify Python Update

The last step is to verify if Python is updated. For that, open the command prompt and type

python -V
Command to verify/check Python version
Python version update verification

As it is showing the version I just upgraded to, this verifies that Python is successfully upgraded.


Update Python on Linux

Linux systems usually have Python installed by default. To check which Python version your system currently has, run

python3 --version
Command to check Python version on Linux

Note: We use python3 keywords because the python keyword is used for Python 2.x which has been deprecated.

Here is how you install Python in Linux.

1. Add Deadsnakes Repository

Open the terminal and run the command:

sudo add-apt-repository ppa:deadsnakes/ppa
Command to add Deadsnakes

2. Refresh the Cache

To refresh the cache, run the following command:

sudo apt update
Command to refresh the cache

3. Install Python to Upgrade

Choose the Python version you are upgrading to (Python 3.11 in my case) and run the command:

sudo apt install python 3.11
Command to install Python on Linux

This will install python3.11 on Linux.

4. Set Default Version

There can be multiple Python versions installed on your system, so you need to specify one default version.

You need to use update-alternatives to create symbolink links to python3.

Run the following commands:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
Command to update alternatives
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
Command to update alternatives

Now, choose the version you want to use as Python3 with the following command:

sudo update-alternatives --config python3

With this, you are ready to use Python 3.11 on your Linux system.


Update Python on Mac

Just like Linux, Mac already has Python installed by default. To update the Python version, you can use Homebrew.

Follow the steps below to update Python on Mac using Homebrew:

1. Install Homebrew

Open the terminal and run the command:

/bin/bash -c “$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)”
Command to install Homebrew on Mac

This will ask for your admin account password (the password you use to log in to your Mac).

After a few minutes, HomeBrew will be installed. You can now use it to upgrade Python. If you face difficulties installing HomeBrew, refer to its official documentation.

2. Upgrade Python

If you are upgrading from Python 2 to 3, run the command:

brew install python3
Command to install Python using Homebrew 

If you already have Python 3, run the command:

brew upgrade python3
Command to upgrade Python using Homebrew

This will upgrade to the latest version of Python 3 on Mac.


Frequently Asked Questions

1. Can I use pip to upgrade Python?

No, you can not upgrade Python using pip. Pip (Pip Install Packages) is a Python package manager, which installs and upgrades Python packages, not Python itself.

2. How do I install the latest version of Python?

Windows:

You can install the latest version of Python by installing the Python installer from Python’s official website.

Linux:

Run the following command on the terminal:

sudo apt install python 3.11
Command to install Python on Linux

Right now, Python 3.11 is the latest Python version.

Mac:

Run the following command on the terminal:

brew upgrade python
Command to upgrade Python on Mac

This will upgrade to the latest Python version on Mac.

3. Is Python 3.9 the latest version?

No, Python 3.9 is not the latest.

4. What is the Python latest version?

The latest Python version is 3.11

Subscribe to Programiz PRO Blog!

Be the first to receive the latest tutorial from Programiz by signing up to our email subscription. Also more bonus like inside looks on the latest feature and many more.

  • Как обновить госуслуги на пк windows
  • Как обновить биос на ноутбуке asus через windows
  • Как обновить версию драйвера на windows 7
  • Как обновить виндовс 7 на ноутбуке до последней версии бесплатно для windows
  • Как обновить драйвер чипсета на windows 10