Ubuntu 20.04下通过apt-get安装Python3.10后无法找到可执行文件的问题咨询
Ubuntu 20.04下通过apt-get安装Python3.10后无法找到可执行文件的问题咨询
大家好,我碰到了一个困惑的问题,想请各位帮忙看看:我已经尝试安装Python3.10,并且通过重新安装的方式来验证,但发现系统里虽然有一些lib*3.10相关的文件,却找不到Python3.10的可执行文件。
我执行的重新安装命令和输出如下:
apt-get install -f -y python3.10 Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'libqgispython3.10.4' for regex 'python3.10' Note, selecting 'libpython3.10-stdlib' for regex 'python3.10' libqgispython3.10.4 is already the newest version (3.10.4+dfsg-1ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
之后我用whereis命令查找Python3.10的位置,结果只显示了Python3.8相关的路径:
/# whereis python3.10 + whereis python3.10 python3: /usr/bin/python3.8 /usr/bin/python3 /usr/lib/python3.8 /usr/lib/python3 /etc/python3.8 /etc/python3 /usr/local/lib/python3.8 /usr/share/python3
查看/usr/lib/python目录下的内容,也只有Python2.7、Python3和Python3.8:
root@136e5fcfd4ec:/# ll /usr/lib/python python2.7/ python3/ python3.8/
这到底是怎么回事呢?
更新
后来我意识到这是Ubuntu 20.04的版本问题,感谢@steeldriver的提示:Python3.10是在Ubuntu 20.04发布之后才推出的,所以默认的软件源里并没有包含Python3.10的可执行包。正确的安装方式应该是先添加第三方PPA源,具体步骤如下:
apt install software-properties-common add-apt-repository ppa:deadsnakes/ppa apt update apt install python3.10
备注:内容来源于stack exchange,提问作者WestCoastProjects




