TT Bigdata TT Bigdata
首页
GitHub (opens new window)
JaneTTR

JaneTTR

数据酿造智慧,每一滴都是沉淀!
  • 报错解决

    • Ambari 报错
      • Ambari Views

      • Ambari

        • phantomjs下载失败问题
        • 编译问题:GCC 安装与配置
        • bower CERT_HAS_EXPIRED 错误问题
        • Ambari-admin包出现bower install错误
        • Cannot run program "rpmbuild"
        • Python: No such file or directory
          • 💥 报错现象
          • 📋 问题分析
          • 🛠️ 解决办法
            • 1. 检查 Python 安装情况
            • 2. 建立 python -> python3 的软链接
            • 3. 重新执行编译命令
        • Yarn解压报错EOFException排查与解决
        • Rpm-maven-plugin与shebang兼容性报错
        • Rpm-maven-plugin 最佳实践
        • Bower install拉取失败解决
        • 缺少 python3 报错解决
        • Python(>=2.6) but is not installed
        • SSL_ERROR_SYSCALL 的修复方法
      • Ambari-infra

      • Ambari-metrics

    • Bigtop 报错
  • 系统适配

  • 监控与调优

  • BUG临时处理
  • 实验室

  • 运维资料
  • 报错解决
  • Ambari 报错
  • Ambari
JaneTTR
2025-05-25
目录
💥 报错现象
📋 问题分析
🛠️ 解决办法
1. 检查 Python 安装情况
2. 建立 python -> python3 的软链接
3. 重新执行编译命令

Python: No such file or directory

# 💥 报错现象

Ambari 源码编译过程中,日志输出如下:


[INFO]
[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-property) @ ambari-server ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:regex-property (full-version) @ ambari-server ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.8:regex-property (regex-schema-version) @ ambari-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-maven-version) @ ambari-server ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M2:enforce (enforce-versions) @ ambari-server ---
[INFO]
[INFO] --- buildnumber-maven-plugin:1.2:create (default) @ ambari-server ---
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] Executing: /bin/sh -c cd /opt/modules/ambari/ambari-server && git rev-parse --verify HEAD
[INFO] Working directory: /opt/modules/ambari/ambari-server
[INFO] Storing buildNumber: 72418a7f0c267c64759057755b06677c24cc6b02 at timestamp: 1748139925310
[INFO] Executing: /bin/sh -c cd /opt/modules/ambari/ambari-server && git rev-parse --verify HEAD
[INFO] Working directory: /opt/modules/ambari/ambari-server
[INFO] Storing buildScmBranch: UNKNOWN
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (process-resource-bundles) @ ambari-server ---
bower jquery#1.9.1 - 3                               extract archive.tar.gz
[INFO] artifact net.minidev:json-smart: checking for updates from aliyunmaven
bower jquery#1.9.1 - 3                              resolved https://github.com/jquery/jquery-dist.git#3.7.1
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:exec (azuredb-gen) @ ambari-server ---
/usr/bin/env: ‘python’: No such file or directory

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

在 Rocky Linux 8/9 等新系统环境下,默认只安装了 python3,而 python 命令并不存在,导致部分依赖 Python 2 的构建步骤失败。


# 📋 问题分析

  • Ambari 2.8.x 及部分大数据开源组件仍依赖 python 软链接(即 Python 2 兼容命令)。
  • 在 Rocky Linux 8/9、CentOS 8/AlmaLinux 8+ 等新版本发行版中,仅自带 python3,未创建 python 软链接 ,直接调用 python 会找不到命令。
  • 相关构建插件/脚本如 exec-maven-plugin 会通过 /usr/bin/env python 方式查找并调用 Python,遇到此问题即报错。

# 🛠️ 解决办法

# 1. 检查 Python 安装情况

which python
which python3
python3 --version
1
2
3

# 2. 建立 python -> python3 的软链接

如系统只存在 python3,可用以下命令建立兼容软链:

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

⚠️ 注意:如果存在对 Python 2 严格依赖的脚本,建议根据实际情况测试,或安装 python2 并指定软链。

弄好后

# 3. 重新执行编译命令

软链建立后,重新运行 Ambari 源码编译命令:

mvn clean install package rpm:rpm -DskipTests ...
1
#Ambari#错误排查#源码编译#Python#Rocky Linux
Cannot run program "rpmbuild"
Yarn解压报错EOFException排查与解决

← Cannot run program "rpmbuild" Yarn解压报错EOFException排查与解决→

最近更新
01
当前版本 2026/08
08-29
02
把 Ambari Server HA 稳稳地跑起来
08-17
03
从一次启用操作追到主备就绪
08-17
更多文章>
Theme by Vdoing | Copyright © 2017-2026 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式