删除默认的python2.7后,在CentOS上重新安装Python

2024-06-02 04:45:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是一个Bluehost云服务器,它有CentOs 6.10 (linux 2.6.32-754.14.2.e16.x86_64),我试图安装python 3.7,但不知何故删除了python2.6,它在centOS中是默认的(从lib、lib64、bin….中删除)。在

现在当我尝试使用yum时,它会给出一个错误:

-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

如何重新安装Python2.6,以便yum能够正常工作?

目前python3.7.1正在运行(/root/python/Python-3.7.1/python),但是我不能安装pip或任何其他python包,比如numpy。在

任何帮助都将不胜感激。 提前谢谢。在


Tags: 服务器bashbinlinuxlibusr错误x86
1条回答
网友
1楼 · 发布于 2024-06-02 04:45:25

来自-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

If you were to restore the /usr/lib/python2.6 directory from another system you would at least be able to run yum again, although your system would still be fundamentally broken. Your best bet is to reinstall from scratch

相关问题 更多 >