问题描述
我正在尝试使用 boto3 为 aws 学习 python,所以我试图执行这里给出的代码 https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html我收到错误module boto3 not found
所以我根据这里的答案升级到 boto3无法安装 boto3提到使用 pip3 install boto3
发出此命令给我以下输出
C:\Users\DEEL>pip3 install boto3收集 boto3下载 https://files.pythonhosted.org/packages/c9/cd/d48602dc99ecb52876cf741477f15c874b631e5776723f27092693a5b535/boto3-1.7.80-py2.py3-none-any.whl(128k乙)100% |████████████████████████████████|133kB 160kB/秒收集 botocore=1.10.80(来自 boto3)下载 https://files.pythonhosted.org/packages/5e/cf/b97f44993766af17bf64aeddadf66f63b6ebf3d700565cc7ee7b13cd0067/botocore-1.10.80-py2.py3-none-any.whl (4.5MB)100% |████████████████████████████████|4.5MB 1.3MB/秒已满足要求:jmespath=0.7.1 in e:\installation2\python3\lib\site-packages(来自 boto3)(0.9.3)已经满足要求:s3transfer=0.1.10 in e:\installation2\python3\lib\site-packages(来自 boto3)(0.1.13)已经满足要求:docutils>=0.10 in e:\installation2\python3\lib\site-packages (from botocore=1.10.80->boto3) (0.14)已经满足要求:python-dateutil=2.1;python_version >="2.7" in e:\installation2\python3\lib\site-packages(来自 botocore=1.10.80->boto3) (2.7.3)已经满足要求:e:\installation2\python3\lib\site-pac中的6>=1.5kages(来自 python-dateutil=2.1;python_version>=2.7"->botocore=1.10.80->boto3) (1.11.0)awscli 1.15.80 要求 botocore==1.10.79,但您将拥有 botocore 1.10.80 不兼容.安装收集到的包:botocore、boto3找到现有安装:botocore 1.10.79卸载 botocore-1.10.79:成功卸载 botocore-1.10.79
在这个输出中有一行awscli 1.15.80 要求 botocore==1.10.79,但您将拥有 botocore 1.10.80 不兼容.
所以基于这里的链接如何将 AWS CLI 升级到最新版本?我升级了 awscli pip3 install –upgrade awscli
在屏幕上得到以下输出
C:\Users\DEEL>pip3 install --upgrade awscli收集awscli下载 https://files.pythonhosted.org/packages/6b/fa/89c248eaacccd816fdea88206060a7cd221f227855782ff7b0ffb80d725a/awscli-1.15.81-py2.py3-none-any.whl(1.3MB)100% |████████████████████████████████|1.3MB 198kB/秒已满足要求,跳过升级: rsa=3.1.2 in e:\installation2\python3\lib\site-packages(来自 awscli)(3.4.2)要求已经满足,跳过升级:PyYAML=3.10 in e:\installation2\python3\lib\site-packages(来自 awscli)(3.13)要求已经满足,跳过升级:colorama=0.2.5 in e:\installation2\python3\lib\site-packages(来自 awscli)(0.3.9)要求已经满足,跳过升级:botocore==1.10.80 in e:\installation2\python3\lib\site-packages(来自 awscli)(1.10.80)要求已经满足,跳过升级:s3transfer=0.1.12 in e:\installation2\python3\lib\site-packages(来自 awscli)(0.1.13)要求已经满足,跳过升级:docutils>=0.10 in e:\installation2\python3\lib\site-packages(来自 awscli)(0.14)需求已经满足,跳过升级:pyasn1>=0.1.3 in e:\installation2\python3\lib\site-packages(来自 rsa=3.1.2->awscli)(0.4.4)要求已经满足,跳过升级:jmespath=0.7.1 in e:\inStallation2\python3\lib\site-packages(来自 botocore==1.10.80->awscli)(0.9.3)要求已经满足,跳过升级:python-dateutil=2.1;python_version >= "2.7" in e:\installation2\python3\lib\site-packages(来自 botocore==1.10.80->awscli) (2.7.3)要求已经满足,跳过升级:e:\installation2\py 中的6>=1.5thon3\lib\site-packages(来自 python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore==1.10.80->awscli) (1.11.0)安装收集的包:awscli找到现有安装:awscli 1.15.80卸载 awscli-1.15.80:成功卸载 awscli-1.15.80成功安装 awscli-1.15.81
我的问题是我在安装 boto3 时收到的不兼容消息是什么 awscli 1.15.80 要求 botocore==1.10.79,但您将拥有 botocore 1.10.80 这是不兼容的.
我如何检查 awscli 和 botocore 安装的兼容性以及应该在我的机器上做什么,以便我在进一步的开发工作中不会遇到问题.>
pip3 列表显示如下
C:\Users\DEEL>pip3 列表套餐版本--------------- -------awscli 1.15.81boto3 1.7.80botocore 1.10.80颜色 0.3.9文档 0.14jmespath 0.9.3点 18.0pyasn1 0.4.4python-dateutil 2.7.3PyYAML 3.13RSA 3.4.2s3transfer 0.1.13设置工具 39.0.1六 1.11.0
我现在应该怎么做才能使 awscli 和 botocore 兼容?
但是我想提一下我正在尝试的代码 https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html 在完成所有这些工作后成功执行.
同样的问题和我的解决方法如下所示.
将 aws-cli 升级到最新版本
$ pip3 install awscli --upgrade --user
卸载现有的先前版本的 botocore 和 boto3
$ pip3 卸载 botocore$ pip3 卸载 boto3
重新安装
$ pip3 install botocore$ pip3 安装 boto3
结果日志
包版本--------------- -------awscli 1.16.1boto3 1.8.1botocore 1.11.1颜色 0.3.9文档 0.14jmespath 0.9.3点 18.0pyasn1 0.4.4python-dateutil 2.7.3PyYAML 3.13RSA 3.4.2s3transfer 0.1.13设置工具 40.0.0六 1.11.0urllib3 1.23虚拟环境 16.0.0轮 0.31.1
I am trying to learn python for aws using boto3 so I was trying to execute code given here https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.htmlI got errors module boto3 not found
so I upgraded to boto3 based on an answer hereUnable to install boto3 mentioned to use pip3 install boto3
issuing of this command gives me following output
C:\Users\DEEL>pip3 install boto3
Collecting boto3
Downloading https://files.pythonhosted.org/packages/c9/cd/d48602dc99ecb52876cf
741477f15c874b631e5776723f27092693a5b535/boto3-1.7.80-py2.py3-none-any.whl (128k
B)
100% |████████████████████████████████| 133kB 160kB/s
Collecting botocore<1.11.0,>=1.10.80 (from boto3)
Downloading https://files.pythonhosted.org/packages/5e/cf/b97f44993766af17bf64
aeddadf66f63b6ebf3d700565cc7ee7b13cd0067/botocore-1.10.80-py2.py3-none-any.whl (
4.5MB)
100% |████████████████████████████████| 4.5MB 1.3MB/s
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in e:\installation2\python
3\lib\site-packages (from boto3) (0.9.3)
Requirement already satisfied: s3transfer<0.2.0,>=0.1.10 in e:\installation2\pyt
hon3\lib\site-packages (from boto3) (0.1.13)
Requirement already satisfied: docutils>=0.10 in e:\installation2\python3\lib\si
te-packages (from botocore<1.11.0,>=1.10.80->boto3) (0.14)
Requirement already satisfied: python-dateutil<3.0.0,>=2.1; python_version >= "2
.7" in e:\installation2\python3\lib\site-packages (from botocore<1.11.0,>=1.10.8
0->boto3) (2.7.3)
Requirement already satisfied: six>=1.5 in e:\installation2\python3\lib\site-pac
kages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.7"->botocore<1.11.
0,>=1.10.80->boto3) (1.11.0)
awscli 1.15.80 has requirement botocore==1.10.79, but you'll have botocore 1.10.
80 which is incompatible.
Installing collected packages: botocore, boto3
Found existing installation: botocore 1.10.79
Uninstalling botocore-1.10.79:
Successfully uninstalled botocore-1.10.79
in this output there is a lineawscli 1.15.80 has requirement botocore==1.10.79, but you'll have botocore 1.10. 80 which is incompatible.
so based on link hereHow to upgrade AWS CLI to the latest version? I upgraded awscli pip3 install –upgrade awscli
got following output on screen
C:\Users\DEEL>pip3 install --upgrade awscli
Collecting awscli
Downloading https://files.pythonhosted.org/packages/6b/fa/89c248eaacccd816fdea
88206060a7cd221f227855782ff7b0ffb80d725a/awscli-1.15.81-py2.py3-none-any.whl (1.
3MB)
100% |████████████████████████████████| 1.3MB 198kB/s
Requirement already satisfied, skipping upgrade: rsa<=3.5.0,>=3.1.2 in e:\instal
lation2\python3\lib\site-packages (from awscli) (3.4.2)
Requirement already satisfied, skipping upgrade: PyYAML<=3.13,>=3.10 in e:\insta
llation2\python3\lib\site-packages (from awscli) (3.13)
Requirement already satisfied, skipping upgrade: colorama<=0.3.9,>=0.2.5 in e:\i
nstallation2\python3\lib\site-packages (from awscli) (0.3.9)
Requirement already satisfied, skipping upgrade: botocore==1.10.80 in e:\install
ation2\python3\lib\site-packages (from awscli) (1.10.80)
Requirement already satisfied, skipping upgrade: s3transfer<0.2.0,>=0.1.12 in e:
\installation2\python3\lib\site-packages (from awscli) (0.1.13)
Requirement already satisfied, skipping upgrade: docutils>=0.10 in e:\installati
on2\python3\lib\site-packages (from awscli) (0.14)
Requirement already satisfied, skipping upgrade: pyasn1>=0.1.3 in e:\installatio
n2\python3\lib\site-packages (from rsa<=3.5.0,>=3.1.2->awscli) (0.4.4)
Requirement already satisfied, skipping upgrade: jmespath<1.0.0,>=0.7.1 in e:\in
stallation2\python3\lib\site-packages (from botocore==1.10.80->awscli) (0.9.3)
Requirement already satisfied, skipping upgrade: python-dateutil<3.0.0,>=2.1; py
thon_version >= "2.7" in e:\installation2\python3\lib\site-packages (from botoco
re==1.10.80->awscli) (2.7.3)
Requirement already satisfied, skipping upgrade: six>=1.5 in e:\installation2\py
thon3\lib\site-packages (from python-dateutil<3.0.0,>=2.1; python_version >= "2.
7"->botocore==1.10.80->awscli) (1.11.0)
Installing collected packages: awscli
Found existing installation: awscli 1.15.80
Uninstalling awscli-1.15.80:
Successfully uninstalled awscli-1.15.80
Successfully installed awscli-1.15.81
my question is what is that incompatibility message which I got when installing boto3 awscli 1.15.80 has requirement botocore==1.10.79, but you'll have botocore 1.10. 80 which is incompatible.
how do I check the compatibility of awscli and botocore installations and what should be done on my machine so that I don't face problems in further development work.
pip3 list shows following
C:\Users\DEEL>pip3 list
Package Version
--------------- -------
awscli 1.15.81
boto3 1.7.80
botocore 1.10.80
colorama 0.3.9
docutils 0.14
jmespath 0.9.3
pip 18.0
pyasn1 0.4.4
python-dateutil 2.7.3
PyYAML 3.13
rsa 3.4.2
s3transfer 0.1.13
setuptools 39.0.1
six 1.11.0
What should I do now so that awscli and botocore are compatible?
However I would like to mention the code which I was trying from https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html executed successfully after all this work.
Same issue here and how I solved is shown below.
Upgrade aws-cli to latest version
$ pip3 install awscli --upgrade --user
Uninstall existing previous version of botocore and boto3
$ pip3 uninstall botocore
$ pip3 uninstall boto3
And Install again
$ pip3 install botocore
$ pip3 install boto3
Result log
Package Version
--------------- -------
awscli 1.16.1
boto3 1.8.1
botocore 1.11.1
colorama 0.3.9
docutils 0.14
jmespath 0.9.3
pip 18.0
pyasn1 0.4.4
python-dateutil 2.7.3
PyYAML 3.13
rsa 3.4.2
s3transfer 0.1.13
setuptools 40.0.0
six 1.11.0
urllib3 1.23
virtualenv 16.0.0
wheel 0.31.1
这篇关于如何检查 awscli 和兼容的 botocore 包是否已安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!