How to Use Python 3.X (3.9, 3.10, or 3.11) as Default for “python3” in Linux? : Chris

How to Use Python 3.X (3.9, 3.10, or 3.11) as Default for “python3” in Linux?
by: Chris
blow post content copied from  Be on the Right Side of Change
click here to view original post


Rate this post

Ready to embrace the power of Python 3.11 as your default Python3 version? 🐍 Let’s make it happen! Just follow these simple steps:

1⃣ First, let’s check your current default Python version. Open your terminal and run the following command:

python3 --version

In my AWS instance, the command python3 pointed to my installed Python version 3.9 instead but I wanted it to point to 3.11.

2⃣ Next, we’ll use update-alternatives to create symbolic links to Python 3.10 and Python 3.11. You can replace it with your specific Python versions as you see fit. Each is identified using an integer value 1 and 2.

Enter these commands one by one:

The first command sets the Python version 3.9 to identifier 1:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1

The second command sets the Python version 3.11 to identifier 2:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2

3⃣ Now, it’s time to choose Python 3.11 as your go-to Python3! 🔥 Type the command below:

sudo update-alternatives --config python3

Now you can type in the identifier of the Python version you want as default for the command python3. In my case, it would be 2 because I want python3.11. See here:

✨ Ta-da! You’ve successfully set up Python 3.11 as your default version! 🎉

Feel free to switch between Python versions at any time using the commands provided above. Remember, with great power comes great responsibility: after switching to 3.11, make sure to check if all your essential apps are working smoothly. 🕵️‍♀️

💡 Recommended: How to Check Your Python Version?


April 18, 2023 at 06:50PM
Click here for more details...

=============================
The original post is available in Be on the Right Side of Change by Chris
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Salesforce