如何检查 awscli 和兼容的 botocore 软件包是否安装

2024-02-19

我正在尝试使用 boto3 学习用于 aws 的 python,所以我尝试执行此处给出的代码https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html我遇到错误module boto3 not found
所以我根据这里的答案升级到了 boto3无法安装boto3 https://stackoverflow.com/questions/33388555/unable-to-install-boto3提到使用pip3 install boto3发出此命令给我以下输出

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

在此输出中有一行awscli 1.15.80 has requirement botocore==1.10.79, but you'll have botocore 1.10. 80 which is incompatible.

所以基于这里的链接如何将AWS CLI升级到最新版本? https://stackoverflow.com/questions/36969391/how-to-upgrade-aws-cli-to-the-latest-version我升级了 awsclipip3 install –upgrade awscli在屏幕上得到以下输出

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

我的问题是我在安装 boto3 时收到的不兼容消息是什么awscli 1.15.80 has requirement botocore==1.10.79, but you'll have botocore 1.10. 80 which is incompatible.如何检查 awscli 和 botocore 安装的兼容性以及应该在我的机器上做什么,这样我就不会在进一步的开发工作中遇到问题。

pip3 列表显示以下内容

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

我现在应该做什么才能使 awscli 和 botocore 兼容?

不过我想提一下我正在尝试的代码https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html https://boto3.readthedocs.io/en/latest/guide/s3-example-creating-buckets.html所有这些工作完成后成功执行。


这里有同样的问题以及我的解决方法如下所示。

将 aws-cli 升级到最新版本

$ pip3 install awscli --upgrade --user

卸载现有的先前版本的 botocore 和 boto3

$ pip3 uninstall botocore
$ pip3 uninstall boto3

并再次安装

$ pip3 install botocore
$ pip3 install boto3

结果日志

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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何检查 awscli 和兼容的 botocore 软件包是否安装 的相关文章

  • 在组织内部分发我的 python 模块

    我用 python 制作了一些模块 我想将它们分发到我的组织内 这些模块已经存储在BitBucket中 例如 有什么方法可以使用 pip install 来分发它们吗 正确的方法是什么 您可以从 GitHub 进行 pip 安装 并且应该能
  • 如何强制send_data在浏览器中下载文件?

    好吧 我的问题是我正在使用send data on my Rails 3应用程序向用户发送文件AWS S3类似的服务 Base establish connection access key id gt my key secret acce
  • 更新AWS S3过期时间

    我想知道如何延长密钥的有效期 我指的不是访问对象的签名 URL 而是密钥本身 我将 AWS 设置为存储桶中的所有对象应在 90 天后过期的规则 在大多数情况下 这就是我希望发生的事情 有时我需要将单个密钥的使用寿命最多再延长 90 天 事实
  • 如何获取AWS ec2中区域的可用容量?

    AWS 终止了我的运行位置 并出现错误 实例终止容量超额订阅 有没有办法查看不同 ec2 区域中实例类型的可用容量 这样我就可以在更 可用 的区域创建我的新位置 查看 现货实例历史记录 这不会告诉您未来 但会给您迄今为止的良好指示 此链接将
  • AWS CLI S3API 查找路径中的最新文件夹

    我有一个非常大的桶 数十万个对象 我有一条路径 假设 s3 myBucket path1 path2 path2 获取也是文件夹的上传内容 因此 示例可能如下所示 s3 myBucket path1 path2 v6 1 0 s3 myBu
  • 带有 s3 路径的张量板 logdir

    我看到tensorflow支持AWS s3文件系统 https github com tensorflow tensorflow tree master tensorflow core platform s3 https github co
  • 为什么在尝试使用 Java 连接到 RDS PostgreSQL 数据库时会收到 SocketTimeoutException?

    我有一个 Spring 应用程序 我试图在 AWS 上托管 几天来我一直在努力配置 我有一个 EC2 实例 并且能够通过 SSH 连接到它 我还在 AWS 中设置了 Postgres RDS 数据库 但我无法使用 IDE 中的代码连接到它
  • 从 Flask 中的 S3 返回 PDF

    我正在尝试在 Flask 应用程序的浏览器中返回 PDF 我使用 AWS S3 来存储文件 并使用 boto3 作为与 S3 交互的 SDK 到目前为止我的代码是 s3 boto3 resource s3 aws access key id
  • 从 EC2 实例 ID 创建 AMI 时,command.resolveMiddleware 不是 AWS SDK 的函数,想知道为什么?

    我当时正在开发 AWS SDK 版本 3 并尝试以编程方式从 EC2 实例创建 AMI 以下是我使用的脚本 Imports TODO Import the ec2 client const EC2Client CreateImageComm
  • 解锁 Jenkins - 如何

    我已经使用 putty 从 Windows 系统在我的 ec2 实例上安装了 jenkins 当我尝试通过网络访问 jenkins 时 我使用 var lib jenkins secrets initialAdminPassword 解锁
  • 配置 PIP 以在代理后面工作

    我已经安装了 python 3 4 3 附带pip 我想从代理后面使用 pip 所以我执行了以下操作 Created C Users foo pip pip ini并添加了代理配置部分 proxy export http proxy my
  • 具有服务器端加密 s3 存储桶的 AWS Cloudfront

    这是对这个问题 https stackoverflow com questions 50166557 how can a cloudfront distribution an aws kms key to get an s3 image e
  • 如何使用对象标记上传到 AWS S3

    有没有办法使用标签将文件上传到AWS S3 不将标签添加到S3中的现有文件 对象 我需要让该文件与我的 Tags 一起出现在 S3 中 即在单个 API 调用中 我需要这个 因为我使用 Lambda 函数 使用这些 S3 对象标签 由 S3
  • S3 不返回 Access-Control-Allow-Origin 标头?

    我无法强制 S3 在从存储桶返回的所有对象上设置 CORS 标头 尽管启用了 CORS 但由于客户端 S3 上传正在工作 返回的对象没有 CORS 标头 我启用的策略是
  • 我们能否知道回形针下载何时完成?

    我有一个应用程序 我需要知道用户的 Rails Paperclip 文件下载时间complete 我的应用程序设置为与 Amazon S3 交互 当用户收到完整的文件时 我需要运行 JavaScript 函数 我怎样才能做到这一点 跟踪天气
  • 使用 C# 获取 ec2-instance 标签

    我不是开发人员 所以也许答案是有不同的解决方案 但我无法真正从 python 或其他东西翻译它 我尝试使用 AWS NET SDK 查找实例 然后获取实例的标签 我已经能够确定实例是否已启动并正在运行 我还了解了如何创建和删除标签 不在下面
  • 无法在 Windows 10 上更新 pip 的 PATH 变量

    我知道有数千个类似的主题 但我的 pip 命令突然停止工作 尽管我进行了所有研究 但我无法弄清楚原因 自从我上次使用 pip 以来已经有一段时间了 令人惊讶的是我的计算机不再识别该命令 我重新安装了pip 提示告诉我PATH变量没有正确更新
  • Django Rest Framework——没有名为rest_framework的模块

    我已经使用安装了 django rest 框架pip install djangorestframework但当我运行 python3 manage py sycndb 时 我仍然收到此错误 导入错误 没有名为 rest framework
  • PyTorch 给出 cuda 运行时错误

    我对我的代码做了一些小小的修改 以便它不使用 DataParallel and DistributedDataParallel 代码如下 import argparse import os import shutil import time
  • 如何自动启动我的 ec2 实例、运行命令然后将其关闭?

    我想每周对 redshift postgres 数据库中的数据运行一次机器学习模型 我使用以下命令将 R 脚本设置为休息 apiplumbr然后我将其设置为一项任务来管理pm2 我有它 所以任务会在ec2实例启动然后继续运行 要让 R 脚本

随机推荐