Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Python 3.10 #7

Closed
scottwestover opened this issue Oct 6, 2021 · 7 comments
Closed

Issue with Python 3.10 #7

scottwestover opened this issue Oct 6, 2021 · 7 comments

Comments

@scottwestover
Copy link

Not sure if this is the right place to report this issue, but I just started getting the following error today in my existing workflows.

It looks like the docker image is currently pointed to 3-alpine, and this was recently updated to use Python 3.10. The aws-cli page mentions that it now supports Python 3.10.

Traceback (most recent call last):
  File "/usr/local/bin/aws", line 27, in <module>
    sys.exit(main())
  File "/usr/local/bin/aws", line 23, in main
    return awscli.clidriver.main()
  File "/usr/local/lib/python3.10/site-packages/awscli/clidriver.py", line 68, in main
    driver = create_clidriver()
  File "/usr/local/lib/python3.10/site-packages/awscli/clidriver.py", line 77, in create_clidriver
    load_plugins(session.full_config.get('plugins', {}),
  File "/usr/local/lib/python3.10/site-packages/awscli/plugin.py", line 44, in load_plugins
    modules = _import_plugins(plugin_mapping)
  File "/usr/local/lib/python3.10/site-packages/awscli/plugin.py", line 61, in _import_plugins
    module = __import__(path, fromlist=[module])
  File "/usr/local/lib/python3.10/site-packages/awscli/handlers.py", line 42, in <module>
    from awscli.customizations.history import register_history_mode
  File "/usr/local/lib/python3.10/site-packages/awscli/customizations/history/__init__.py", line 24, in <module>
    from awscli.customizations.history.db import DatabaseConnection
  File "/usr/local/lib/python3.10/site-packages/awscli/customizations/history/db.py", line 19, in <module>
    from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)
@daniterrin
Copy link

Same thing here. We've started to see the problem today. After looking for a solution, the problem seems to be that collections.MutableMapping has been deprecated since Python 3.3, and was officially removed since Python 3.9.

@edmarbarros
Copy link

Currently experiencing the same issue here.

@scottwestover @daniterrin did you had any success solving that?

@jpeace-pro
Copy link

Currently experiencing same issue. Looked at trying this out and suggesting that to this branch:
https://stackoverflow.com/questions/59636631/aws-cli-with-python-3-9-0a1-error-from-collections-import-mutablemapping

@edmarbarros
Copy link

Maybe we can simply update the Dockerfile to use a compatible python version?

FROM python:3.8-alpine

@scottwestover
Copy link
Author

scottwestover commented Oct 6, 2021

@edmarbarros I was able to get around the issue by using the aws cli directly for my current workflow. I was not aware that the AWS-CLI was preinstalled in the GitHub hosted environments (my workflows are currently using these).

I found a reference to that here: aws/aws-cli#4835

Example of what I am running now:

env:
  CI: true
  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
  merge-build:
    runs-on: ubuntu-latest

    strategy:
      fail-fast: true

    steps:
      ....
      # Deploy to S3
      - name: deploy to AWS S3
        run: aws s3 sync --acl private dist/ s3://${{env.S3_BUCKET_NAME}}

This resolved the issue for the time being.

@daniterrin
Copy link

@edmarbarros I went for a pretty similar approach. I'm now using the official docker image of aws-cli in my CI-CD pipeline in Github. You can find more info here aws/aws-cli#3553.

I assume that the issue might also be fixed by changing the version of aws-cli that dockerfile retrieves from 3-alpine. However, I can't test it.

jaaaco added a commit to kamawietrzyk/czaryMarry that referenced this issue Nov 11, 2021
@ItsKarma
Copy link
Owner

ItsKarma commented Mar 5, 2022

Thank you for this and apologies for the incredibly delayed response.
I believe this should be resolved now with #8.
Please let me know if anyone is still experiencing this issue and we can re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants