- How to Update Python Version? — [Upgrade Python Version]
- What is PIP?
- How to update Python on Windows Operating System?
- How To Upgrade Python on macOS?
- How to Update Python version on LINUX?
- Conclusion
- Как обновить Python в Linux?
- Введение
- Обновление Python
- Обновление Python в Debian Linux (Ubuntu, Raspbian, Mint и другие)
- Обновление Python в Red Hat Linux (CentOS и Fedora Linux)
- Заключение
- How to Upgrade Python to 3.9
- Upgrading Python on Windows OS
- Upgrade to Python 3 with the Installer
- Install Python 3.9 from the Microsoft Store
- Upgrading Python on macOS
- Upgrade Python using Homebrew
- Upgrade Python with the Installer
- Upgrading Python in Linux
- Why Should You Upgrade Python?
- How to upgrade to Python 3.8 on Ubuntu 18.04 LTS
- Install Python 3.8
- Step 1: Add the repository and update
- Step 2: Install the Python 3.8 package using apt-get
- Step 3: Add Python 3.6 & Python 3.8 to update-alternatives
- Step 4: Update Python 3 for point to Python 3.8
- Step 5: Test the version of python
- Install Laravel on Ubuntu 16.04 with Apache
- How to Install Node on Ubuntu 18.04 or 20.04
- 413 request entity too large error solution
- 14 Comments
How to Update Python Version? — [Upgrade Python Version]
Are you looking to update Python version to the latest python version? Then this blog post will guide you with how to 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 and plugins on their machine and even software from several major suppliers. It means that 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 packages installation and administration. Pip’s popularity stems from the large number of 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, 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, how it can be modified, upgraded, and set up.
How to update Python on Windows Operating System?
Go to the Python update page and download and install the Python 3.9 installer to update the python on your windows system. You’re still undecided about which version to have. It is recommended to use the Windows x86–64 executable installer.
Python Installer (Recommended) (Screenshot from the Python Download page)
Check the «Add Python to Path» option during installation to register Python3.9 as your system’s main Python.
How To Upgrade Python on macOS?
You can download the latest version of Python for macOS from the official Python website, similar as you did on windows OS to update Python version on your system. To check it is updated to the lasted version or not follow the below-listed commands to check Python version.
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:
Then, at the bottom, add this segment.
Python 3.9 version can be checked using the following command.
How to Update Python version on LINUX?
Users can use the below listed Linux commands to upgrade Python version to the latest released version:
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 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
$ sudo python3 —version
$ sudo python3.9 —version
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.
Источник
Как обновить Python в Linux?
Руководство по обновлению Python в операционных системах семейства Linux.
Введение
Представь себе ситуацию, ты придумал какой-нибудь проект, решил реализовать его на Python, открываешь терминал и обнаруживаешь старую версию, например Python 3.4.
Правильно, обновить Python через пакетный менеджер.
Далее я расскажу как это сделать.
Все команды необходимо выполнять под пользователем root или же через sudo.
Обновление Python
Рассмотрим несколько примеров обновления Python в самых популярных дистрибутивах
Обновление Python в Debian Linux (Ubuntu, Raspbian, Mint и другие)
В моем случае я буду использовать raspberrypi 4 с дистрибутивом raspbian (основан на Debian buster). Открываем терминал (или подключаемся по ssh) и вводим команду apt update
Видим примерно такую же ситуацию, локальный репозиторий обновил информацию о доступным пакетах из сетевого репозитория и стали доступны обновления других пакетов. Но мы сейчас не об этом. Нас интересует только python.
Далее вводим команду
В моем дистрибутиве используется последняя доступная версия 3.7.3-1
Обновление Python в Red Hat Linux (CentOS и Fedora Linux)
В принципе обновление пакетов в linux имеет схожий алгоритм. Сперва вы получаете список доступных пакетов из удаленного репозитория и сравнивание с тем, что установлено у вас локально. После обновление локального репозитория нужно инициализировать установку python. Разнообразных дистрибутивов linux у меня под рукой нет, да и используя я в серверных вариантах только debian-based. Но информация о работе с другими пакетными менеджерами доступна онлайн:)
Обновление python выполняется одной командой
Заключение
В этом руководстве мы узнали как обновить Python в Linux.
Источник
How to Upgrade Python to 3.9
Home » SysAdmin » How to Upgrade Python to 3.9
Every fresh Python release comes with bug fixes and new features. Python 3.9, the latest point release at the time of writing, comes with features such as improved time zone support, dictionary updates, and more flexible decorators.
This tutorial shows you how to upgrade Python to version 3.9 on all the major operating systems — Windows, macOS, and Linux.
- Administrative rights on the operating system you are using.
- Knowledge of which Python version is currently on your system. If you need help finding out the version of your Python installation, check out How to Check Python Version.
Note: If you are upgrading from a Python 2 release and do not have Python 3 installed, read our comprehensive guides on how to install it on:
Upgrading Python on Windows OS
To upgrade Python on Windows, download the installer or search for the app in the Microsoft Store.
Upgrade to Python 3 with the Installer
1. In your browser, visit the Python Releases for Windows section on the official Python website.
2. Click the Download Python button to download the installation file on your computer.
3. Next, run the Python installer. If you are upgrading from another point release of Python 3 (for example, 3.8.10), the installer suggests to install Python 3.9. Select Install Now to install Python with recommended options, or select Customize Installation to pick the install location and features.
If you already have an older version of the same Python release (for example, 3.9.1), the installer offers to upgrade your Python installation. Proceed by selecting Upgrade Now.
4. When the installation finishes, check whether the new version of Python has been installed successfully. Open Windows PowerShell and type:
The output should show the latest version of Python, as in the image below.
Install Python 3.9 from the Microsoft Store
If you want to use Python 3.9 to learn the basics or test some simple concepts, find and install the Python 3.9 app from the Microsoft Store.
1. Go to Microsoft Store and type Python in the search field.
2. Select Python 3.9 from the search results that appear.
3. Click the Get button to start the installation.
Start the interactive Python 3.9 experience by finding the app in the Start Menu.
Upgrading Python on macOS
On macOS, Python can be installed, upgraded, and maintained using the command line interface or the GUI.
Upgrade Python using Homebrew
Install Python in the macOS terminal using the Homebrew package manager. If you do not have Homebrew, install it by typing the following script in the terminal:
Then, proceed with the steps:
1. Update Homebrew by running:
2. If you are upgrading from Python 2, install Python 3 with the command:
If you already have a version of Python 3 installed, upgrade the package with the brew upgrade command:
Upgrade Python with the Installer
1. In your browser, navigate to the Python Releases for macOS page, on Python’s official website.
2. Click the link to download the latest Python 3 release on your computer.
3. Run the installer. Go through the installation steps by clicking Continue, agreeing to the License, and confirming the installation location and type.
4. Once the installation is complete, select Close.
5. Finally, confirm that the new Python version has been successfully installed by typing the following in terminal:
The output should display the latest version of Python.
Upgrading Python in Linux
This article uses Ubuntu and its APT package manager to upgrade Python. If you are using a different Linux distribution, replace the apt command with the appropriate command featured for your package manager.
Warning: Many Linux systems have Python 2 installed as the system version. Removing Python 2 could cause a system error. If you are planning to install Python 3 on Linux, install it alongside Python 2 and invoke it with the python3 command.
1. Start by updating the repositories:
2. Next, install Python 3.9 by running:
When prompted, type Y to start the installation.
3. Once Python installs, invoke the 3.9 version by running:
4. However, checking the installation with the python3 —version command still returns the old version. To fix this, you need to create a list of update alternatives. First, add the old version to the list with the command:
5. Now add the new version:
6. Next, type the following command to configure the priority status of the versions:
The output displays the available choices and their assigned number (in the example below, the numbers are 0, 1, 2). Type the number of the the version you wish to use and press Enter.
7. If you are not planning to use the old version of Python, remove the symlink that contained the previous Python 3 version with:
8. Then, replace the symlink with the new version:
9. Now, check the default version:
The output should confirm the successful installation and setup of the latest available version.
Why Should You Upgrade Python?
Since Python 3 was not a backward-compatible release, for a long time Python 2 remained the version of choice for those who wanted a stable development environment. Some services like Google App Engine did not support Python 3 for a long time.
However, given that the official support for the final Python 2.7 release has ended, upgrading to Python 3 is now strongly recommended. Python 3 is faster, and its syntax is more user-friendly.
If you already work with Python 3, upgrading to the latest point release gives you all the security updates and bug fixes.
After reading this tutorial, you should know how to upgrade your Python 3 version on Windows, macOS, and Linux. If you want to learn more about Python, read our article on Python data types.
Источник
How to upgrade to Python 3.8 on Ubuntu 18.04 LTS
In this article, we will upgrade to python 3.8 and configure it as the default version of python.
The current stable version of python released on 14 Oct. 2019. Many ubuntu users are facing problems during upgrading python to the latest version. Python 3.6.9 available as default when we install Ubuntu 18.04 LTS. Python 3.8 is not available in default Ubuntu 18 repositories.
So let’s start with checking the currently installed version of Python on your system.
As seen in the image above, my currently installed Python version is 3.6.9 but yours may differ.
Table of Contents
Install Python 3.8
Follow the simple steps to install and configure Python 3.8
Step 1: Add the repository and update
Latest Python 3.8 not available in Ubuntu’s default repositories. So, we have to add an additional repository. On launchpad repository named deadsnakes is available for Python Packages.
Add the deadsnakes repository using the below commands.
Update the package list using the below command.
Verify the updated Python packages list using this command.
As seen in the image above, Now we have Python 3.8 available for installation.
Step 2: Install the Python 3.8 package using apt-get
install Python 3.8 by using the below command :
Step 3: Add Python 3.6 & Python 3.8 to update-alternatives
Add both old and new versions of Python to Update Alternatives.
Step 4: Update Python 3 for point to Python 3.8
By default, Python 3 is pointed to Python 3.6. That means when we run python3 it will execute as python3.6 but we want to execute this as python3.8.
Type this command to configure python3:
You should get the above output. Now type 2 and hit enter for Python 3.8. Remember the selected number may differ so choose the selection number which is for Python 3.8.
Step 5: Test the version of python
Finally, test the current version of python by typing this :
You should get Python 3.8 as output.
In this article, we learn how to upgrade python to the latest version that is 3.8 in Ubuntu 18.10.
Share your thoughts in the comment section. Happy Learning …!!
You May Also Like
Install Laravel on Ubuntu 16.04 with Apache
How to Install Node on Ubuntu 18.04 or 20.04
413 request entity too large error solution
14 Comments
Thanks for the procedure. pretty straight forward and helped me to upgrade it.
This didn’t work for me… I read the article and follow all the steps, then the terminal wouldn’t launch.. I believe the problem occurred because I set python up with anaconda (The cadillac of open-source python distros).
If this happens to you, open xterm (since we can’t access the terminal right now). Then run ‘sudo update-alternatives –config python3’ and choose the old version of python (3.6 in this case). Now the terminal can open like normal, but we still haven’t installed python 3.8.
[reference: https://askubuntu.com/questions/780626/terminal-wont-lauch-ubuntu-16-04
this will work for 18.04 as well]
There is a way better way to install python 3.8 that is much easier (requires conda):
0) navigate to your home directory
1) run ‘sudo apt-get remove python3.8’, to undo the damage done by this article.
2) run ‘conda create -n py38 anaconda=2020.02 python=3.8’
3) finally after all the packages are installed run ‘conda activate py38’, in fact conda will prompt you to do so with instructions!
Now you have installed py38 to your python3 path, additionally it is the active environment. We can check this by entering the command ‘python3 -V’ or equivalently ‘python3 –version’ (same same). Either command should print: ‘Python 3.8.1’, as desired.
Hopefully if you run into the same problem as I did that this solves your issue.
[reference: https://stackoverflow.com/questions/58568175/upgrade-to-python-3-8-using-conda%5D
I think the lesson to learn here is to trust stack exchange to have an answer, just my require some digging, but every question seems to have been asked with wonderful answers and comments on answers (where all the true gems are to be found).
Источник