gpt4 book ai didi

python - 如何修复 "update-alternatives: warning: forcing reinstallation of alternative/usr/bin/python3.8 because link group python3 is broken"?

转载 作者:行者123 更新时间:2023-12-04 18:43:38 25 4
gpt4 key购买 nike

使用 Ubuntu 16.04.7 我试图将 python3.8 作为我的默认 python 版本。我按照 here 给出的说明进行操作,但最终标准 python 版本没有改变。每当我运行

python -V
输出总是
Python 3.7.9
这是 sudo update-alternatives --config python3 的输出:
There are 2 choices for the alternative python3 (providing /usr/bin/python3).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/python3.8 2 auto mode
1 /usr/bin/python3.7 1 manual mode
2 /usr/bin/python3.8 2 manual mode

Press <enter> to keep the current choice[*], or type selection number:
当我选择“0”时,出现错误:
update-alternatives: warning: forcing reinstallation of alternative /usr/bin/python3.8 because link group python3 is broken
谷歌上唯一的近距离打击是另一个没有答案的 SO entry!
那么我该如何解决这个问题呢?
此外,这是 ls -l /usr/bin/python* 的输出:
lrwxrwxrwx 1 root root      18 Oct 17  2019 /usr/bin/python -> /usr/bin/python2.7
lrwxrwxrwx 1 root root 9 Nov 24 2017 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3488528 Jul 21 19:57 /usr/bin/python2.7
lrwxrwxrwx 1 root root 33 Jul 21 19:57 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root 16 Nov 24 2017 /usr/bin/python2-config -> python2.7-config
-rwxr-xr-x 1 root root 306 Oct 24 2015 /usr/bin/python2-futurize
-rwxr-xr-x 1 root root 310 Oct 24 2015 /usr/bin/python2-pasteurize
lrwxrwxrwx 1 root root 25 Oct 5 08:59 /usr/bin/python3 -> /etc/alternatives/python3
-rwxr-xr-x 2 root root 4456208 Jul 19 22:14 /usr/bin/python3.5
lrwxrwxrwx 1 root root 33 Jul 19 22:14 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config
-rwxr-xr-x 2 root root 4456208 Jul 19 22:14 /usr/bin/python3.5m
lrwxrwxrwx 1 root root 34 Jul 19 22:14 /usr/bin/python3.5m-config -> x86_64-linux-gnu-python3.5m-config
-rwxr-xr-x 2 root root 5074632 Aug 18 09:35 /usr/bin/python3.7
-rwxr-xr-x 2 root root 5074632 Aug 18 09:35 /usr/bin/python3.7m
-rwxr-xr-x 1 root root 5391992 Sep 26 00:51 /usr/bin/python3.8
lrwxrwxrwx 1 root root 16 Mar 23 2016 /usr/bin/python3-config -> python3.5-config
lrwxrwxrwx 1 root root 10 Mar 23 2016 /usr/bin/python3m -> python3.5m
lrwxrwxrwx 1 root root 17 Mar 23 2016 /usr/bin/python3m-config -> python3.5m-config
lrwxrwxrwx 1 root root 16 Nov 24 2017 /usr/bin/python-config -> python2.7-config
lrwxrwxrwx 1 root root 58 Mar 25 2016 /usr/bin/pythontex -> ../share/texlive/texmf-dist/scripts/pythontex/pythontex.py
-rwxr-xr-x 1 root root 306 Mar 25 2016 /usr/bin/pythontex3

最佳答案

我为 python 定义了一个别名!这就是为什么传统逻辑在这里不适用的原因!

关于python - 如何修复 "update-alternatives: warning: forcing reinstallation of alternative/usr/bin/python3.8 because link group python3 is broken"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64203820/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com