How to change default python 3.8.10 to 3.10?

I have already installed python 3.10 but show 3.8 in terminal. I am using python3 -V command in terminal. I am using pycharm and show different version between two. when I install package in terminal it is not working on pycharm terminal or import.

3.8 is the system's version and will be updated with the OS. As a developer, I use 3.9 and 3.10 utilizing the update alternative command, leaving the 3.8 for the OS and developing with the other two.

It is not recommended to attempt to update the system version! This will break things. Python is an integral part of the OS and will be updated as the developers update the libraries and other parts of the OS. I've tried this, and trust me, it's using the version that is necessary for this set of libraries and configuration.


if i install package in terminal, cant import in pycharm or qt creator. not detected.

Use update alternatives command to set up alternate python versions (there are many tutorials on the web that explain it better than I could. Try How to Use update-alternatives Command on Ubuntu). Activate the one you are using for development and it will be the one used by the terminal. The system will still use the 3.8 version. Without this you are installing these packages in the system python version in the system packages folder, which can later create conflicts.

Are you creating a virtual environment in order to do your development? Make sure to use python3 and pip3 commands inside the virt env (aliases won't work).

1 Like

Listen, There are two python's running on ubuntu, One is for the OS and one is the Basic idle version which can be installed. We do not install and run modules on the OS python. We run modules by using the basic idle or anaconda interface. Interfering in OS python will break the system as that python is installed by synaptic. It can be used for programs But, not recommended, Cause all the configurations you perform, like x = 1 is saved in the OS configuration forever.

Install Idle by,

sudo apt install idle

Then, all the modules you install including pycharm can be accessed using idle. Programs like sql can be accessed only using the terminal. But, if you can use Idle for python then why interfere in OS version?

Also, As Zorin is Ubuntu 20.04 It does not support python 3.10 and the highest supported version is 3.8 for idle and maybe 3.7 for OS version :thinking:

Also, Try Contacting the Python Community.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.