AWS CLI 的依赖关系冲突

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

我目前有 awscli==1.32.2 我在密码学之间存在依赖冲突,openssl 你能告诉我它们将在哪个版本上一起工作而没有依赖冲突吗

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pyopenssl 23.3.0 requires cryptography<42,>=41.0.5, but you have cryptography 38.0.4 which is incompatible.

  Successfully uninstalled cryptography-38.0.4

错误:pip 的依赖解析器当前未考虑所有已安装的软件包。此行为是以下依赖性冲突的根源。 awscli 2.9.19 需要加密技术<=38.0.5,>=3.3.2,但您拥有不兼容的加密技术 41.0.7。

我尝试卸载加密并再次安装,但没有成功。 我如何知道哪些版本彼此兼容

amazon-web-services openssl cryptography dependencies aws-cli
1个回答
0
投票

有多种方法可以查看依赖关系。更复杂的方法是找到与您感兴趣的包关联的“METADATA”文件。您可以通过首先运行“pip show”命令并将包名称作为参数来完成此操作。例如:

$ pip show pyOpenSsl
Name: pyOpenSSL
Version: 23.3.0
Summary: Python wrapper module around the OpenSSL library
Home-page: https://pyopenssl.org/
Author: The pyOpenSSL developers
Author-email: [email protected]
License: Apache License, Version 2.0
Location: /home/testuser/.local/lib/python3.11/site-packages
Requires: cryptography
Required-by:

然后转到位置并查找附加了“-versionNumber.dist-info”的包名称。例如:

pyOpenSSL-23.3.0.dist-info

如果您查看该目录,您应该会找到 METADATA 文件。该文件的顶部应该包含包的依赖关系信息。每个依赖项都标有“RequiresDist:”例如:

$ more METADATA
Metadata-Version: 2.1
Name: awscli
Version: 1.32.5
Summary: Universal Command Line Environment for AWS.
Home-page: http://aws.amazon.com/cli/
Author: Amazon Web Services
License: Apache License 2.0
Project-URL: Source, https://github.com/aws/aws-cli
Project-URL: Reference, https://docs.aws.amazon.com/cli/latest/reference/
Project-URL: Changelog, https://github.com/aws/aws-cli/blob/develop/CHANGELOG.rst
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >= 3.8
License-File: LICENSE.txt
Requires-Dist: botocore (==1.34.5)
Requires-Dist: docutils (<0.17,>=0.10)
Requires-Dist: s3transfer (<0.10.0,>=0.9.0)
Requires-Dist: PyYAML (<6.1,>=3.10)
Requires-Dist: colorama (<0.4.5,>=0.2.5)
Requires-Dist: rsa (<4.8,>=3.1.2)

现在更简单的方法是安装“pipdeptree”命令:

pip install pipdeptree

它实际上更像是一个命令,而不是一个 python 包。安装后,只需运行它:

$ pipdeptree
awscli==1.32.5
├── botocore [required: ==1.34.5, installed: 1.34.5]
│   ├── jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1]
│   ├── python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2]
│   │   └── six [required: >=1.5, installed: 1.16.0]
│   └── urllib3 [required: >=1.25.4,<2.1, installed: 2.0.7]
├── colorama [required: >=0.2.5,<0.4.5, installed: 0.4.4]
├── docutils [required: >=0.10,<0.17, installed: 0.16]
├── PyYAML [required: >=3.10,<6.1, installed: 6.0.1]
├── rsa [required: >=3.1.2,<4.8, installed: 4.7.2]
│   └── pyasn1 [required: >=0.1.3, installed: 0.5.1]
└── s3transfer [required: >=0.9.0,<0.10.0, installed: 0.9.0]
    └── botocore [required: >=1.33.2,<2.0a.0, installed: 1.34.5]
        ├── jmespath [required: >=0.7.1,<2.0.0, installed: 1.0.1]
        ├── python-dateutil [required: >=2.1,<3.0.0, installed: 2.8.2]
        │   └── six [required: >=1.5, installed: 1.16.0]
        └── urllib3 [required: >=1.25.4,<2.1, installed: 2.0.7]
pip==23.3.2
pipdeptree==2.13.1
pyOpenSSL==23.3.0
└── cryptography [required: >=41.0.5,<42, installed: 41.0.7]
    └── cffi [required: >=1.12, installed: 1.16.0]
        └── pycparser [required: Any, installed: 2.21]
setuptools==66.1.1
wheel==0.38.4
© www.soinside.com 2019 - 2024. All rights reserved.