benkehoe / aws-sso-credential-process

Bring AWS SSO-based credentials to the AWS SDKs until they have proper support
Apache License 2.0
48 stars 1 forks source link

ModuleNotFoundError: No module named 'urllib3.packages.six.moves' #2

Closed samidalouche closed 1 year ago

samidalouche commented 1 year ago

How to reproduce (Mac OS 14.1 (23B74)):

rm -rf ~/.local/pipx
brew install pipx
pipx install aws-sso-credential-process
aws-sso-credential-process --profile <my-sso-profile-name>
Traceback (most recent call last):
  File "/Users/samidalouche/.local/bin/aws-sso-credential-process", line 5, in <module>
    from aws_sso_credential_process.aws_sso_credential_process import main
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/aws_sso_credential_process/__init__.py", line 1, in <module>
    from .aws_sso_credential_process import __version__
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/aws_sso_credential_process/aws_sso_credential_process.py", line 36, in <module>
    from botocore.session import Session
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/session.py", line 26, in <module>
    import botocore.client
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/client.py", line 15, in <module>
    from botocore import waiter, xform_name
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/waiter.py", line 18, in <module>
    from botocore.docs.docstring import WaiterDocstring
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/docs/__init__.py", line 15, in <module>
    from botocore.docs.service import ServiceDocumenter
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/docs/service.py", line 13, in <module>
    from botocore.docs.bcdoc.restdoc import DocumentStructure
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/docs/bcdoc/restdoc.py", line 17, in <module>
    from botocore.compat import OrderedDict
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/botocore/compat.py", line 32, in <module>
    from urllib3 import exceptions
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/urllib3/connectionpool.py", line 11, in <module>
    from .exceptions import (
  File "/Users/samidalouche/.local/pipx/venvs/aws-sso-credential-process/lib/python3.12/site-packages/urllib3/exceptions.py", line 2, in <module>
    from .packages.six.moves.http_client import IncompleteRead as httplib_IncompleteRead
ModuleNotFoundError: No module named 'urllib3.packages.six.moves'
samidalouche commented 1 year ago

Example fix: https://github.com/benkehoe/aws-sso-credential-process/commit/b30dde15f6860722eb38b39858e364d0818dfd8a

Simply updated urllib3 to 2.0.7 and the problem disappeared.

poetry build
pipx install dist/aws_sso_credential_process-0.3.1-py3-none-any.whl
benkehoe commented 1 year ago

I'm not maintaining this version any more, especially because all the AWS SDKs now have support for Identity Center and the AWS CLI has aws configure export-credentials that can serve the purpose as well.

samidalouche commented 1 year ago

I'm not maintaining this version any more, especially because all the AWS SDKs now have support for Identity Center and the AWS CLI has aws configure export-credentials that can serve the purpose as well.

Thanks! This is helpful.

awsume still needs the credential_process = process hack, so very useful to know that aws configure export-credentials provides the same functionality

benkehoe commented 1 year ago

Also, aws-sso-util can populate your Identity Center profiles and automatically includes a credential process. Though it is going to be early next year before I add support for the newer session-style profiles.