How to Install Python 3.x or 2.7 on Debian 11 Bullseye Linux – Guide

Learn the commands to install Python 3.x and Python 2.7 on Debian 11 Bullseye or 10 Buster using the terminal and also set the default version. Python is a free, open source programming language for a wide range of software projects. This programming language comes with clear syntax and good readability. It is considered easy to learn and can be interpreted on common operating systems. Also, Python offers good scalability and can be used for complex software projects. Due to the expressive and minimalist syntax, applications can be implemented with just a few lines of code and less susceptible to programming errors. To ensure simplicity and clarity, Python does well with few keywords and uses indents as structuring elements. The platform-independent programming language Python runs on Windows, Linux / Unix, Mac OS X and more. There are also integrations into Java virtual machines e. LIQUID. ºand Python programming language offers a number of advantages.

The most important advantages are briefly summarized below:

Installing Python 3 or 2 on Debian 11 Bullseye Linux

1. Run system update

We must run the system update command before installing any packages on the Linux system. This rebuilds the system repository cache and helps you recognize the latest versions of packages available for installation. sudo apt update

2. Install Python 3.9 on Debian 11 or 10

Although if you are using Full-DVD GUI Debian 11 or 10 Desktop, Python 3.x will already be there on your system. However, minimal users of the Debian system can go to the command given below. sudo apt install python3 python3-pip

3. To install Python 2.7 and Pip on Debian 11 (optional)

If you also want Python 2 on your Debian, run the given command: sudo apt install python To install Python 2.7 pip, use the following: sudo apt install curl curl https://bootstrap.pypa.io/pip/2.7/get-pip.py –output get-pip.py sudo python2 get-pip.py pip2 –version

3. Check installed versions

Once the installation is complete, you can check which versions are installed exactly for Python 3 and 2 using the command given below: python3.9 –version python2 –version pip –version

4. Set the default Python version to 3

If you have installed Python 3 and 2 on your Debian 11 or 10 system, the default version will be set to Python 2, so you can change it to Python 2 if you wish. Check the Python versions available on your system: ls / usr / bin / python * To set the desired version as the default, use the commands below: Edit Bash Profile: nano ~ / .bash_profile Add the following line. you can change the version, with another one available if you wish. python alias = ‘usr/bin/python3.9‘ Here we are setting 3.9 as the default. Now, log out and log in again or simply provide the bash file: source ~ / .bash_profile Finally, check the default version: python –version

Final note

I hope you like the guide How to Install Python 3.x or 2.7 on Debian 11 Bullseye Linux. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.

How to Install Python 3 x or 2 7 on Debian 11 Bullseye Linux  2022  - 27How to Install Python 3 x or 2 7 on Debian 11 Bullseye Linux  2022  - 61How to Install Python 3 x or 2 7 on Debian 11 Bullseye Linux  2022  - 17How to Install Python 3 x or 2 7 on Debian 11 Bullseye Linux  2022  - 21