5

Ubuntu18.04升级Python3.6之后terminal无法打开

 7 months ago
source link: http://fancyerii.github.io/2024/02/13/ubuntu-terminal/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Ubuntu18.04升级Python3.6之后terminal无法打开

Posted by lili on February 13, 2024

最近把Ubuntu18.04的python升级到python3.9之后发现terminal无法打开了。搜索了一下,是gnome-terminal只能使用3.6(含)之前的版本。最简单的办法是用update-alternatives把python3修改成python3.6(不用修改python,这是两个不同的东西,有的程序会使用python,因为它在Ubuntu18.04里默认是2.7,另外一些程序会使用python3来明确的说明版本要求)。但是我不希望系统的python3版本太低,因为有些程序它要求比较高的版本。搜索了一下,发现这里有比较好的解决方法,那就是修改/usr/bin/gnome-terminal,修改第一行:

#!/usr/bin/python3
#!/usr/bin/python3.6

就可以了,这样terminal使用python3.6,而系统的python3指向新版本的python。



About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK