最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ubuntu - Terminal stops launching after downgrading Python version - Stack Overflow

programmeradmin0浏览0评论

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 Generally it is not recommended to touch system python. Best way to change python version is to use python version manager like pyenv or uv. – Yoshikage Kira Commented Mar 13 at 3:08
  • See this to fix your python version back askubuntu/questions/1397938/… – Yoshikage Kira Commented Mar 13 at 3:11
  • you could have command python3.9 to run code with this version. If cqlsh is Python script then you may run it as python3.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 with python3.9 – furas Commented Mar 13 at 18:00
Add a comment  | 

1 Answer 1

Reset to default 1

I 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!

发布评论

评论列表(0)

  1. 暂无评论