Update python version windows

How to Update Python

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”).
Читайте также:  Phpstorm настройка версии php

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

command python3 -V on terminal to check python version

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: 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

command to configure Python 3: sudo update-alternatives --config python3

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: 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

Читайте также:  Python constant in class

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

Updating Python in Windows

Upgrade to Python 3.7.4 prompt window

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: 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

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.

Источник

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

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

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

Введение

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

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

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

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

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

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

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

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

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

Установка

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

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

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

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

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

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

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

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

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

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

Заключение

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

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

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

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

Егоров Егор

К сожалению автор не указал, что «обновить Python» невозможно! И короткий ответ на заголовок статьи — НИКАК! Можно поставить новую версию. А вот как управляться имея разные версии — это вопрос интересный!

Скажу по секрету, что большинство программ обновлясь перезаписывают свои данные так же как и полная переустановка, только это происходит в тихом режиме, скрытом от пользователя.

Питон не затирает старую версию. И при установки новой версии у вас после будут стоять несколько версий питона.
По этому если хотите только одну версию сначала нужно удалить все предыдущие.
Или можно просто выбирать интерпретатор тот который требуется

У меня Windows 7 32bit, ну можно сказать старичок ноутбук он разумеется моложе чем я (на 4 года+-, так как я не знаю был ли он когда мне было 8 летб сейчас 13)
и версия 3.9.4 показывает что виндовс старый (нужна версия чтобы хотя бы работал pygame и pyinstaller, чтобы работала банальная змейка и разные пинг понг (питону только учусь месяц, интересно что ровно потому что начал я 15 числа сентября). Если автор поможет потому что я так сказать по мягче даже не понимаю нафига он что за него такие суммы платят хотя это просто программа(типа Майнкрафт за $2.5 миллиарда)), надеюсь за граматику ни кто не на ругает.

Честно говоря, никогда не сталкивался с проблемой несоответствия версий операционной системы и python. На сколько я сейчас знаю (а я не пользуюсь windows уже очень давно), Windows 7 вышла из официальной поддержки Microsoft, может вам все таки обновить систему до актуальной версии и проблема решится ?:)

Писака прав. На 7 винде 3.6 что ли версия максимум ставится, около того. И если уж ты решил плотненько сесть на программирование, то не хотел бы рассмотреть в качестве операционной системы что-то из линукс дистрибутивов?

Источник

Оцените статью