In this guide, you updated from Python 3.7 to Python 3.9 using the Debian Testing repository. On Debian 10, the binary for Python 2 is located at /usr/bin/python, and the binary for Python 3 is located at /usr/bin/python3.
Now your Debian 10 system has the latest version of Python 3 installed. Verify that you’ve updated Python by checking the version: python3 -version Otherwise, you may decide to restart the services yourself. If you are not running any active processes, this is okay. Append the following line of text to the end of the file: deb testing non-free contrib mainīecause Python3 requires a lot of dependencies, you are prompted to allow Debian to restart certain services. Open the /etc/apt/sources.list file with the following command: sudo nano /etc/apt/sources.listĪdd the official testing repository.
To upgrade your version of Python from 3.7 to 3.9, you need to add Debian’s testing repositories. Python 3.9 may become a dependency for certain applications running on your system as well. These changes could be useful to take advantage of when writing code.
Major changes between Python 3.7 and 3.9. On a fresh Debian 10 install, the installed version of Python 3 is 3.7. You can exit the interpreter by typing the exit command: exit()Īt this guide’s publication time, the latest stable version of Python 3 was 3.9.1. The interpreter instantly returns the following output: hello world Try it by typing the following print statement: print('hello world')
In the interpreter you can write Python code in real time. The installed version of Python is 3.7.3. The interpreter outputs the version number, the version of the C compiler that Python uses on Linux, and some initial commands to get started. Type "help", "copyright", "credits" or "license" for more information. Try it by typing python3 into the shell: python3 The Python Interpreter, sometimes referred to as the Python Shell or the Python Interactive Shell, is a tool that lets you interact with Python from the command line. You can also launch the Python Interpreter. Instead, interact with Python 3 using the python3 command and Python 2 using the python command. It is not recommended to remove the Python 2 binary from your system. On Debian 10, Python 2 continues to be supported past the EOL date of Python 2. There are default packages that depend on Python 2. You can verify the specific versions of each by appending -version after typing python or python3 in the shell.īecause of Debian’s commitment to stability, Python 2 is still installed on the system.
Update your system: sudo apt update & sudo apt upgradeĪ fresh Debian 10 installation has both Python 2 and Python 3 installed by default. Setting Up and Securing a Compute Instance to create a standard user account, harden SSH access, and remove unnecessary network services. To provision a Linode running Debian 10, follow our This guide assumes that you have access to a server or workstation running Debian 10. If you are interested in porting your already existing Python 2 code to Python 3, please refer to the This guide walks you through installing the latest version of Python 3 on Debian 10. Python 2 is no longer a supported language. This abstraction makes writing and reading the code easier than other languages.Īs of January 1, 2020, the official version of Python is Python 3. A lot of its popularity is based on Python’s high level of abstraction.
Python is also a commonly adopted programming language by people entering into the field of software development. It’s useful for writing everything from small scripts to full-scale software. Python is a popular programming language created in 2000, by Guido van Rossum.