TT Bigdata TT Bigdata
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 模板代码

    • 各类组件
    • 通用模板
  • 国产化&其他系统

    • Centos系列
    • Kylin系列
    • OpenEuler系列
    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 定制开发

    • 组件版本定制
    • 样式风格定制
  • 蓝图愿景
  • 技术支持
  • 合作共建
GitHub (opens new window)

JaneTTR

数据酿造智慧,每一滴都是沉淀!
首页
  • 部署专题

    • 常规安装
    • 一键部署
  • 组件安装

    • 常规&高可用
  • 版本专题

    • 更新说明
  • Ambari-Env

    • 环境准备
    • 开始使用
  • 组件编译

    • 专区—Ambari
    • 专区—Bigtop
  • 报错解决

    • 专区—Ambari
    • 专区—Bigtop
  • 其他技巧

    • Maven镜像加速
    • Gradle镜像加速
    • Bower镜像加速
    • 虚拟环境思路
    • R环境安装+一键安装脚本
    • Ivy配置私有镜像仓库
    • Node.js 多版本共存方案
    • Ambari Web本地启动
    • Npm镜像加速
    • PostgreSQL快速安装
    • Temurin JDK 23快速安装
  • 成神之路

    • 专区—Ambari
    • 专区—Bigtop
  • 集成案例

    • Redis集成教学
    • Dolphin集成教学
    • Doris集成教学
    • 持续整理...
  • 模板代码

    • 各类组件
    • 通用模板
  • 国产化&其他系统

    • Centos系列
    • Kylin系列
    • OpenEuler系列
    • Rocky系列
    • Ubuntu系列
  • 生产调优

    • 组件调优指南
    • 1v1指导调优
  • 定制开发

    • 组件版本定制
    • 样式风格定制
  • 蓝图愿景
  • 技术支持
  • 合作共建
GitHub (opens new window)
  • Ambari

    • phantomjs下载失败问题
    • 编译问题:GCC 安装与配置
    • bower CERT_HAS_EXPIRED 错误问题
    • Ambari-admin包出现bower install错误
    • Cannot run program "rpmbuild"
    • Python: No such file or directory
    • Yarn解压报错EOFException排查与解决
    • Rpm-maven-plugin与shebang兼容性报错
    • Rpm-maven-plugin 最佳实践
    • Bower install拉取失败解决
    • 缺少 python3 报错解决
      • 1. 报错日志还原
      • 2. 问题原因分析
      • 3. 一键解决方案
  • Ambari-infra

  • Ambari-metrics

  • 报错解决-Ambari
  • Ambari
JaneTTR
2025-05-25
目录

缺少 python3 报错解决

# 1. 报错日志还原

Ambari 源码编译阶段遇到如下典型错误日志:

[DEBUG] Adding artifact: com.fasterxml.woodstox:woodstox-core:jar:5.4.0 with file: /root/.m2/repository/com/fasterxml/woodstox/woodstox-core/5.4.0/woodstox-core-5.4.0.jar to assembly locat
ion: var/lib/ambari-agent/cred/lib/woodstox-core-5.4.0.jar.
[DEBUG] Adding file: /root/.m2/repository/com/fasterxml/woodstox/woodstox-core/5.4.0/woodstox-core-5.4.0.jar to archive location: var/lib/ambari-agent/cred/lib/woodstox-core-5.4.0.jar
[INFO] Building tar : /opt/modules/ambari3/ambari-agent/target/ambari-agent-3.0.0.0.0.tar.gz
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:exec (generate-hash-files) @ ambari-agent ---
[DEBUG] Configuring mojo org.codehaus.mojo:exec-maven-plugin:1.2.1:exec from plugin realm ClassRealm[plugin>org.codehaus.mojo:exec-maven-plugin:1.2.1, parent: jdk.internal.loader.ClassLoad
ers$AppClassLoader@30946e09]
[DEBUG] Configuring mojo 'org.codehaus.mojo:exec-maven-plugin:1.2.1:exec' with basic configurator -->
[DEBUG]   (f) arguments = [../ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py, /opt/modules/ambari3/ambari-agent/target/cache/]
[DEBUG]   (f) basedir = /opt/modules/ambari3/ambari-agent
[DEBUG]   (f) classpathScope = runtime
[DEBUG]   (f) environmentVariables = {PYTHONPATH=target/ambari-agent-3.0.0.0.0:${env.PYTHONPATH}}
[DEBUG]   (f) executable = /opt/modules/ambari3/ambari-agent/../ambari-common/src/main/unix/ambari-python-wrap
[DEBUG]   (f) longClasspath = false
[DEBUG]   (f) project = MavenProject: org.apache.ambari:ambari-agent:3.0.0.0.0 @ /opt/modules/ambari3/ambari-agent/target/.flattened-pom.xml
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@4694f70f
[DEBUG]   (f) skip = false
[DEBUG]   (f) workingDirectory = /opt/modules/ambari3/ambari-agent
[DEBUG] -- end configuration --
[DEBUG] Toolchains are ignored, 'executable' parameter is set to /opt/modules/ambari3/ambari-agent/../ambari-common/src/main/unix/ambari-python-wrap
[DEBUG] Executing command line: /opt/modules/ambari3/ambari-agent/../ambari-common/src/main/unix/ambari-python-wrap ../ambari-server/src/main/python/ambari_server/resourceFilesKeeper.py /o
pt/modules/ambari3/ambari-agent/target/cache/
env: ‘python3’: No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:01 min (Wall Clock)
[INFO] Finished at: 2025-06-05T11:16:20Z
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "replaceurl" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (generate-hash-files) on project ambari-agent: Command execution failed. Process exited with an error: 127 (Ex
it value: 127) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (generate-hash-files) on project ambari-agent: Command executi
on failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:840)
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:362)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:840)
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 127 (Exit value: 127)
    at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:377)
    at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:160)
    at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:610)
    at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:352)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:196)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:186)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:539)
    at java.util.concurrent.FutureTask.run (FutureTask.java:264)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:635)
    at java.lang.Thread.run (Thread.java:840)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[root@rocky8 modules]#


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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

报错截图

警告

这是由于系统中未安装 python3,导致 Ambari 调用 py 脚本的 shell 封装工具直接失败,从而整个 Maven lifecycle 中断。


# 2. 问题原因分析

  • Ambari 3.x 及新版依赖大量 Python3 脚本(如 agent/server/init、资源拷贝等),而默认 Rocky8/CentOS8 有可能未自带 python3。
  • exec-maven-plugin 在编译阶段调用 py 脚本时,若找不到 python3 解释器,则直接抛出 127 错误码。
  • 此问题不局限于 Ambari,几乎所有集成 Python3 脚本的 Maven/Gradle 编译任务都可能遇到。

如果只装了 python2 环境依赖 或未做软链接,均会触发该类报错。

# 3. 一键解决方案

只需补全 python3 解释器即可修复:

dnf install -y python3
1

提示

建议始终用 dnf/yum 官方包,避免用自建软链接(如 ln -s /usr/bin/python2 /usr/bin/python),否则后续脚本兼容性难以保证。

#Ambari#源码编译#Python#环境依赖#构建报错
Bower install拉取失败解决
org.apache.commons.io does not exist

← Bower install拉取失败解决 org.apache.commons.io does not exist→

最近更新
01
Pandoc 缺失导致 SparkR 构建失败
06-08
02
Cyrus SASL/GSASL 缺失解决
06-07
03
Hadoop_3.3.4 编译实战 1.0.0+
06-06
更多文章>
Theme by Vdoing | Copyright © 2017-2025 JaneTTR | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式