/bin/sh: python: not found 问题

简介: /bin/sh: python: not found 问题

原因

python 可能被 python2 或者 python 3 代替了导致映射不到。

解决

# 执行
ls -l /usr/bin/python*

显示

lrwxrwxrwx 1 root root       9 3月  16 09:09 /usr/bin/python3 -> python3.6
-rwxr-xr-x 1 root root 4526456 11月  7 18:44 /usr/bin/python3.6
-rwxr-xr-x 1 root root 4526456 11月  7 18:44 /usr/bin/python3.6m
lrwxrwxrwx 1 root root      10 3月  16 09:09 /usr/bin/python3m -> python3.6m

发现确实没有 /usr/bin/python 映射。所以重建映射, 将/usr/bin/python 映射到 /usr/bin/python3 上去

执行

sudo ln -s /usr/bin/python3 /usr/bin/python

再次验证

lrwxrwxrwx 1 root root      16 3月  17 10:51 /usr/bin/python -> /usr/bin/python3
lrwxrwxrwx 1 root root       9 3月  16 09:09 /usr/bin/python3 -> python3.6
-rwxr-xr-x 1 root root 4526456 11月  7 18:44 /usr/bin/python3.6
-rwxr-xr-x 1 root root 4526456 11月  7 18:44 /usr/bin/python3.6m
lrwxrwxrwx 1 root root      10 3月  16 09:09 /usr/bin/python3m -> python3.6m

问题解决


相关文章
|
4月前
|
Python
【Python】已解决:ValueError: Worksheet named ‘Sheet’ not found
【Python】已解决:ValueError: Worksheet named ‘Sheet’ not found
349 0
|
3月前
|
API 开发工具 Python
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法
【Azure Developer】使用 Azure Python SDK时,遇见 The resource principal named https://management.azure.com was not found in the tenant China Azure问题的解决办法
|
3月前
|
中间件 Python Windows
【Azure 应用服务】Python flask 应用部署在Aure App Service中作为一个子项目时,解决遇见的404 Not Found问题
【Azure 应用服务】Python flask 应用部署在Aure App Service中作为一个子项目时,解决遇见的404 Not Found问题
|
4月前
|
自然语言处理 Python
【Python】已解决:Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
【Python】已解决:Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
394 1
|
4月前
|
XML 数据格式 Python
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
113 0
|
4月前
|
自然语言处理 Java 开发工具
【Python】已解决Resource averaged_perceptron_tagger not found. Please use the NLTK Downloader to obtain t
【Python】已解决Resource averaged_perceptron_tagger not found. Please use the NLTK Downloader to obtain t
153 0
|
4月前
|
自然语言处理 Python
【Python】已解决:Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:
【Python】已解决:Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:
212 0
|
4月前
|
Java 开发工具 git
【Python】已解决:ERROR: No matching distribution found for JPype1
【Python】已解决:ERROR: No matching distribution found for JPype1
306 0
|
4月前
|
Java Python
【Python】已解决:ERROR: No matching distribution found for JPype
【Python】已解决:ERROR: No matching distribution found for JPype
364 0
|
4月前
|
Python
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
安装 supervisor报错执行python setup.py install时No local packages or working download links found for meld3
36 0