- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
本剧安装python3
, pip3
, boto3
和 botocore
,并尝试使用 aws_s3 模块下载文件:
TASK [run yum update -y using yum module]
**********************************************************************
ok: [ip-10-200-2-137.us-west-2.compute.internal]
TASK [Install python3 and pip3] *************************************************************************************************
changed: [ip-10-200-2-137.us-west-2.compute.internal]
TASK [Install boto3 and botocore with pip3 module] ******************************************************************************
changed: [ip-10-200-2-137.us-west-2.compute.internal]
TASK [Create a directory if it does not exist using file module] ****************************************************************
changed: [ip-10-200-2-137.us-west-2.compute.internal]
TASK [downlod file from s3 with aws_s3 module] **********************************************************************************
fatal: [ip-10-200-2-137.us-west-2.compute.internal]: FAILED! =>
{"changed": false, "msg": "Python modules \"botocore\" or \"boto3\"
are missing, please install both"}
它失败了,因为它说
boto3
不见了,但实际上不是:
boto3
已安装:
[ec2-user@ip-10-200-2-137 ~]$ pip3 freeze
boto3==1.9.120
botocore==1.12.120
docutils==0.14
jmespath==0.9.4
python-dateutil==2.8.0
s3transfer==0.2.0
six==1.12.0
urllib3==1.24.1
[ec2-user@ip-10-200-2-137 ~]
这是安装
boto3
的任务:
- name: Install boto3 and botocore with pip3 module
pip:
name:
- boto3
- botocore
executable: pip-3.7
这是失败的任务:
- name: downlod file from s3 with aws_s3 module
aws_s3:
bucket: mybucket
object: mybucket/jre-8u201-linux-x64.tar.gz
dest: /home/ec2-user/updater/jre-8u201-linux-x64.tar.gz
mode: get
目标主机确实安装了两个版本的 Python:
[ec2-user@ip-10-200-2-157 ~]$ which python
/usr/bin/python
[ec2-user@ip-10-200-2-157 ~]$ which python3
/usr/bin/python3
我的配置文件如下所示:
[defaults]
private_key_file=/home/ec2-user/manual-builds/key.pem
ansible_python_interpreter=/usr/bin/python3
这是一个错误吗?我看到一些类似的问题被问到近一年前,但我没有看到任何解决方案 - 非常感谢您的帮助。
最佳答案
问题是我的剧本有两个任务,而 Ansible 使用 python2 解释器来处理第一个和第二个。第二个任务需要 python3 解释器才能工作,所以我必须在任务级别指定它:
- name: downlod file from s3 with aws_s3 module
vars:
ansible_python_interpreter: /usr/bin/python3
aws_s3:
bucket: launch-data
object: jre-8u201-linux-x64.tar.gz
dest: /home/ec2-user/updater/jre-8u201-linux-x64.tar.gz
mode: get
关于Ansible aws_s3 模块失败时说缺少 Boto3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55308062/
我有以下项目结构: root |- module |- module.py |- __init__.py |- tests |- unit |- some_test.py
考虑以下代码: import tensorflow as tf from tensorflow.python.estimator.model_fn import EstimatorSpec from
PS D:\Projects\ANIS\Decentralized_Bank> truffle 编译 正在编译您的契约(Contract)... Compiling .\src\contracts\M
我注意到 bool在 QtCreator 中以不同于其他类型的颜色突出显示: 只有在包含某些 header 时才会发生这种情况,最终我将其追踪到 . QtCreator 的代码检查器似乎无法手动跟踪
我创建了自己的 PackagesResourceConfig,如下所示: import com.sun.jersey.api.core.PackagesResourceConfig; import j
我正在尝试将 java.util.UUID 保存到 timeuuid 类型的 Cassandra 列中。例如,这是一个默认的 spring-data-cassandra 映射:http://docs.
我看到安装了 mysql2 gem,但没有安装 mysql。所以我做了一点 $ brew install mysql,我收到了这个警告: 警告:mysql-5.6.13 已经安装 我应该怎么做才能解决
Raspbian Buster 默认有 Python3.7。我正在尝试制作 Python3.6 virtualenv。我全新安装了带有桌面的 Raspbian Buster(不是带有“推荐软件”的版本
我是一名优秀的程序员,十分优秀!