lea*_*ner 0 python python3 18.10
我最近从 18.04 升级到 18.10,但遇到了一个新问题。
当我输入 python 时,我得到这个
Python 3.7.3(默认,2019 年 4 月 9 日,04:56:51)
Linux 上的 [GCC 8.3.0]
但是当我输入 python3 时,出现错误
bash: /usr/lib/command-not-found: /usr/bin/python3: 错误的解释器: 没有这样的文件或目录
我无法打开 ny 终端,因此我将 /usr/bin/gnome-terminal 的第一行更改为:
!#usr/bin/python从那时#!usr/bin/python3起我就可以打开我的终端了。输入后sudo apt-get update我收到此错误
sh: 1: /usr/lib/cnf-update-db: not found
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi'
E: Sub-process returned an error code
Run Code Online (Sandbox Code Playgroud)
不管我是否进入
点
或者
点3
我收到此错误
bash: /usr/local/bin/pip: /usr/bin/python3: bad interpreter: No such file or directory
我尝试sudo update-alternatives --config python3
过There is only one alternative in link group python3 (providing /usr/bin/python3.6): /usr/bin/python3.7
Nothing to configure.
但是当我打字时sudo update-alternatives --config python我得到
There are 2 choices for the alternative python (providing /usr/bin/python).
Run Code Online (Sandbox Code Playgroud)
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/python3.6 2 auto mode
* 1 /usr/bin/python3.6 2 manual mode
2 /usr/bin/python3.7 2 manual mode
当我单击软件和更新和软件更新程序的图标时,它们也未加载
python从你的命令行必须指向 python2.7
你可能把你的公寓弄乱了。删除您的符号链接并替换为默认的 python
sudo rm /usr/bin/python
sudo ln -sf /usr/bin/python2.7 /usr/bin/python
同样,对于 Ubuntu 18.10 python3 指向 python3.6
sudo rm /usr/bin/python3
sudo ln -sf /usr/bin/python3.6 /usr/bin/python3