Jenkins 无法找到 boto3 模块

问题描述 投票:0回答:1

我已经从 Jenkins 管道执行了一个 python

boto3
脚本,作业失败并出现以下错误 -

import boto3 ImportError: No module named boto3

Jenkins 在

AWS EC2
t2.xlarge
上运行,
boto3
模块安装在 python2.7(默认)和 python3.5 上。 如果我使用
ec2
ec2-user
实例执行 python 脚本,我不会看到上述错误。

如有任何解决方案,请告诉我。

谢谢。

python amazon-web-services jenkins jenkins-pipeline boto3
1个回答
0
投票

以 jenkins 用户身份登录并安装 boto3。以下命令供参考:

sudo su -s /bin/bash jenkins
pip install boto3 --user
© www.soinside.com 2019 - 2024. All rights reserved.