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

Как обновить 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 есть в шапке. Залетай.

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 — это универсальный язык программирования, широко используемый в различных областях разработки ПО. Обновление 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 на вашем компьютере.

How to Update Python Version? - [Upgrade Python Version]

List of content you will read in this article:

Python is an open-source high-level programming language that allows users to execute commands, plugins on their machine, and even software from several major suppliers. It means you can operate it on many different operating systems, including the Windows VPS Server. Python is a cross-platform programing language.

Pip is one of the best applications for Python package installation and administration. Pip’s popularity stems from the many apps that use this tool. Pip enables 3rd Party package installed to manage binary packages with the quickly configured package manager. Since Python’s latest releases have piping as normal, this guide will explain how to install PIP and how to update Python version with a complete step-by-step guide.

What is PIP?

PIP is a software management framework for installing and managing Python-written program packages. It is called the ‘preferred software installer’ or ‘Pip Installs Packages.’ PIP, used for Python, is a command-line interface for handling PyPI program installation. You might need to upgrade PIP if you’re using an earlier version of Python on Windows. Download the application file, open the command- line and start the installer to run PIP on Windows quickly. It will teach you how PIP is installed on Windows and how it can be modified, upgraded, and set up.

How to update Python on Windows Operating System?

There are two simple ways to update your current Python version with the latest one. They are as follows: 

  1. Using the Python Installer
  2. Using the Windows Chocolatey Package Manager

So let’s see how we can update the Python version with these two methods, one by one.

Method 1: Python update on Windows using the Python Installer

This method of updating the Python version will work if Python is installed or not on your System.

If Python is already installed on your system, you can check it using the python -V command.

Step 1: Download the Python installer from the Official Website of Python

The easiest way to update the Python version is to download the latest version from the official website (https://www.python.org/downloads/)

You can click on the Download Python 3.11.0 button, and it will download the latest compatible Python version for your system.

Step 2: Install the Downloaded Python Installer

After downloading the exe file, double-click on it to install Python.

Step 3: Install Python

Now, you can install the latest version of Python.

Check the “Add python.ext to PATH”, then click on the “Install Now” button.

This will start the installation process. 

After processing, the latest version of Python will be installed on your system. 

Click on the “Close” Button.

Step 4: Verify the Update

After successful installation, you can verify whether or not the latest version is installed on your system. To check the version, you can again run the same command, python -V, on the prompt command.

Now, you can see that it is showing the latest installed version, i.e., Python 3.11.0.

Note: If it still shows the old version, you may restart your system. Or uninstall the old version from the control panel.

Method 2: Install Python using Command Line Only using the Chocolatey Package Manager

Chocolatey is a Package Manager command line tool for windows, and we can use it to install software for our window system. In our case, we can use it to install Python or update the current version of Python.

Step 1 Open The Powershell as Administrator

To install Chocolatey, you need to open PowerShell as Administrator.

Step 2: Install the Chocolatey Package Manager Command

Now, you can install the Chocolatey package manager using the following command.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Step 3: Verify the Chocolatey Installation

Now, you need to check whether Chocolatey has been installed successfully. To check it, run the “choco” command.

It is installed successfully because it is showing version Chocolatey v1.2.0.

Step 4: Update Python with Chocolatey

With the help of the choco upgrade command, we can update our current Python version.

choco upgrade python -y

Step 5: Verify the Version

You can again check the latest installed Python version using the following command.

python -V

Note: The old version of Python will remain on your system. You can uninstall the old version from the control panel.

How To Upgrade Python on macOS?

You can download the latest version of Python for macOS from the official Python website, similar to what you did on windows OS to update Python version on your system. To check whether it is updated to the lasted version or not, follow the below-listed commands to check the Python version.

$ python --version

Python 2.x.x

$ python3 --version

Python 3.9.0

If you want to execute this new Python release with the python command instead of python3, install an alias in your $HOME directory’s bash profile file.

Open the terminal window and type the following commands:

$ cd $HOME
$ nano .bash_profile

Then, at the bottom, add this segment.

alias python="python3"

Python 3.9 version can be checked using the following command.

$ python --version

Python 3.9.0

How to Update Python version on LINUX?

Users can use the below listed Linux commands to upgrade Python version on the Linux server:

ppa:deadsnakes/ppa can be added to the system’s Software Sources to upgrade the machine with unsupported packages from this untrusted PPA.

$ sudo add-apt-repository ppa:deadsnakes/ppa

This command is used to update the Python package.

$ sudo apt update
$ sudo apt install python3.9

Then, using the commands below, you can search the versions of your new and current Python installations:

This command will show you the following version of python installed in your system

$ sudo python --version

2.x.x

$ sudo python3 --version

3.8.x

$ sudo python3.9 --version

3.9.0

Conclusion

We have seen how to update Python version on operating systems like Windows, Mac OS, and Linux. Follow the guide carefully to update your python software. We believe this guide fulfills your requirement though you can install the latest version successfully. Leave your comments below for your feedback and queries.

People Are Also Reading:

  • How to Learn Python
  • How to Install Python on Windows
  • How to Install Python on Ubuntu
  • How to Check Python Version?

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.

  • Как обновить драйвер lan на windows 10
  • Как обновить драйвер сканера на windows 10
  • Как обновить виндовс 7 до windows 10 на компьютере бесплатно без ключа
  • Как обновить драйвер iphone на windows
  • Как обновить биос на компьютере windows 10 asrock