aws-cli
aws-cli copied to clipboard
[v2] cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_
Describe the issue
With v2, botocore is bundled in a version 2.0.0 which can not use urllib3 v2.2.2. This is a problem in Linux distribution which can not have easily more than one version of the same module.
Additional Information/Context
Processing /builddir/build/BUILD/aws-cli-2.17.53
Preparing metadata (pyproject.toml): started
Running command Preparing metadata (pyproject.toml)
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: awscli
Building wheel for awscli (pyproject.toml): started
Running command Building wheel for awscli (pyproject.toml)
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/aws-cli-2.17.53/backends/pep517.py", line 64, in build_wheel
_inject_wheel_extras(os.path.join(wheel_directory, whl_filename))
File "/builddir/build/BUILD/aws-cli-2.17.53/backends/pep517.py", line 189, in _inject_wheel_extras
_build_and_inject_ac_index(BUILD_DIR, extracted_wheel_dir)
File "/builddir/build/BUILD/aws-cli-2.17.53/backends/pep517.py", line 217, in _build_and_inject_ac_index
ac_index_build_name = _build_ac_index(build_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/aws-cli-2.17.53/backends/pep517.py", line 228, in _build_ac_index
from awscli.autocomplete.generator import generate_index
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/autocomplete/generator.py", line 17, in <module>
from awscli.autocomplete.serverside.indexer import APICallIndexer
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/autocomplete/serverside/indexer.py", line 18, in <module>
import awscli.clidriver
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/clidriver.py", line 22, in <module>
import botocore.session
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/session.py", line 27, in <module>
import botocore.client
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/client.py", line 16, in <module>
from botocore import UNSIGNED, waiter, xform_name
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/waiter.py", line 17, in <module>
from botocore.docs.docstring import WaiterDocstring
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/docs/__init__.py", line 15, in <module>
from botocore.docs.service import ServiceDocumenter
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/docs/service.py", line 14, in <module>
from botocore.docs.client import ClientDocumenter, ClientExceptionsDocumenter
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/docs/client.py", line 16, in <module>
from botocore.docs.example import ResponseExampleDocumenter
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/docs/example.py", line 13, in <module>
from botocore.docs.shape import ShapeDocumenter
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/docs/shape.py", line 19, in <module>
from botocore.utils import is_json_value_header
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/utils.py", line 36, in <module>
import botocore.httpsession
File "/builddir/build/BUILD/aws-cli-2.17.53/awscli/botocore/httpsession.py", line 21, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'DEFAULT_CIPHERS' from 'urllib3.util.ssl_' (/usr/lib/python3.12/site-packages/urllib3/util/ssl_.py)
error: subprocess-exited-with-error
× Building wheel for awscli (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
CLI version used
2.17.53
Environment details (OS name and version, etc.)
Mageia cauldron
Hi @papoteur-mga,
Thanks for reaching out! I've opened https://github.com/aws/aws-cli/pull/8930 to port the fixes from Botocore into the CLI v2 to ensure consistency.
As you're likely aware though, the CLI v2 does not officially support urllib3 2.x at this time. For your current use case, if there are still ongoing issues after that's merged, we'd recommend installing the CLI v2 in a virtualenv to isolate it from system dependencies. That should avoid a number of common issues between your Linux Package Manager and pip.
#8930 has been merged and should be available in the next release. I'll provide an update once that's finished and we'll plan to close this out if we don't hear back with any other concerns.
The change should be available starting in 2.17.54 which was recently released. That should resolve the immediate issue noted in this ticket. I'll plan to resolve this at the end of today if we don't hear back anything further. Thanks!
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.