欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Linux CentOS安装zsh插件提示/usr/bin/env: python: No such file or directory。

程序员文章站 2022-03-08 19:27:33
...

执行 ./install.py 文件时,提示:

/usr/bin/env: python: No such file or directory

查看系统已安装的 python 版本:

➜  ~ ls -l /usr/bin | grep python
lrwxrwxrwx  1 root root          36 112 18:11 python -> /etc/alternatives/unversioned-python
lrwxrwxrwx  1 root root          25 112 18:08 python3 -> /etc/alternatives/python3
lrwxrwxrwx  1 root root          31 1121 2019 python3.6 -> /usr/libexec/platform-python3.6
lrwxrwxrwx  1 root root          17 1121 2019 python3.6-config -> python3.6m-config
lrwxrwxrwx  1 root root          32 1121 2019 python3.6m -> /usr/libexec/platform-python3.6m
lrwxrwxrwx  1 root root          39 1121 2019 python3.6m-config -> /usr/libexec/platform-python3.6m-config
lrwxrwxrwx  1 root root          46 1121 2019 python3.6m-x86_64-config -> /usr/libexec/platform-python3.6m-x86_64-config
lrwxrwxrwx  1 root root          32 112 18:08 python3-config -> /etc/alternatives/python3-config
lrwxrwxrwx  1 root root          24 112 18:11 unversioned-python -> /etc/alternatives/python

设置系统默认 python 版本为 python3:

alternatives --set python /usr/bin/python3 

python 环境安装完毕,可以执行 ./install.py 了。