I recently upgraded my Ubuntu through it's upgrade suggestion from 22.04
to 24.04
. when I try python --version
I see 3.12.x
. But this caused my cqlsh
command doesn't work, cause it needs a lower Python version.
So I decided to install Python 3.9
and add it as an alternative, change the configuration via sudo update-alternatives --config python3
to use Python 3.9 as default version. But as soon as I did it, the terminal didn't launch.
I am not a fan of Python's virtual environments and looking for a way to downgrade the Python 3.12 system wide to something with most compatibility and reliability..
How can I do that?
I recently upgraded my Ubuntu through it's upgrade suggestion from 22.04
to 24.04
. when I try python --version
I see 3.12.x
. But this caused my cqlsh
command doesn't work, cause it needs a lower Python version.
So I decided to install Python 3.9
and add it as an alternative, change the configuration via sudo update-alternatives --config python3
to use Python 3.9 as default version. But as soon as I did it, the terminal didn't launch.
I am not a fan of Python's virtual environments and looking for a way to downgrade the Python 3.12 system wide to something with most compatibility and reliability..
How can I do that?
Share Improve this question edited Mar 13 at 4:38 Erick Ramirez 16.5k2 gold badges21 silver badges31 bronze badges asked Mar 13 at 2:59 best_of_manbest_of_man 73812 silver badges29 bronze badges 3 |1 Answer
Reset to default 1I advised you in #79502731 that downgrading Python is not a good idea since it changes the Python version for the whole system, not just for the application/client that is using it.
The recommended way for dealing with applications that require a different version is to run it in a virtual environment using virtualenv or venv, or switch between Python versions with pyenv. Cheers!
python3.9
to run code with this version. Ifcqlsh
is Python script then you may run it aspython3.9 cqlsh
(you can create script with this line) or you can check first line in script - if it is#!/usr/bin/env python
then you can put#!/usr/bin/env python3.9
and it should run it withpython3.9
– furas Commented Mar 13 at 18:00