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

ImportError: cannot import name 'Mapping' from 'collections' #18

Open
don1uppa opened this issue Dec 28, 2021 · 1 comment
Open

ImportError: cannot import name 'Mapping' from 'collections' #18

don1uppa opened this issue Dec 28, 2021 · 1 comment

Comments

@don1uppa
Copy link

I'm using python 3.10 and installed all the requirements.
The program fails immediatly on the import error, here is the stack trace:

C:\dci\data_migration\venv\Scripts\python.exe C:/dci/data_migration/exportdynamodb/entrypoints/main.py --profile dev -t Carriers -f csv -o carriers.csv
Traceback (most recent call last):
File "C:\dci\data_migration\exportdynamodb\entrypoints\main.py", line 7, in
from boto3 import Session
File "C:\dci\data_migration\venv\lib\site-packages\boto3_init_.py", line 16, in
from boto3.session import Session
File "C:\dci\data_migration\venv\lib\site-packages\boto3\session.py", line 17, in
import botocore.session
File "C:\dci\data_migration\venv\lib\site-packages\botocore\session.py", line 25, in
import botocore.configloader
File "C:\dci\data_migration\venv\lib\site-packages\botocore\configloader.py", line 19, in
from botocore.compat import six
File "C:\dci\data_migration\venv\lib\site-packages\botocore\compat.py", line 25, in
from botocore.exceptions import MD5UnavailableError
File "C:\dci\data_migration\venv\lib\site-packages\botocore\exceptions.py", line 15, in
from botocore.vendored.requests.exceptions import ConnectionError
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests_init_.py", line 58, in
from . import utils
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\utils.py", line 26, in
from .compat import parse_http_list as parse_list_header
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\compat.py", line 7, in
from .packages import chardet
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\packages_init
.py", line 3, in
from . import urllib3
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\packages\urllib3_init_.py", line 10, in
from .connectionpool import (
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\packages\urllib3\connectionpool.py", line 38, in
from .response import HTTPResponse
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\packages\urllib3\response.py", line 9, in
from .collections import HTTPHeaderDict
File "C:\dci\data_migration\venv\lib\site-packages\botocore\vendored\requests\packages\urllib3_collections.py", line 1, in
from collections import Mapping, MutableMapping
ImportError: cannot import name 'Mapping' from 'collections' (C:\Users\diuppa\AppData\Local\Programs\Python\Python310\lib\collections_init
.py)

Thoughts?

@don1uppa
Copy link
Author

don1uppa commented Dec 28, 2021

I did a search, I had success with Python 3.9.9.

make changes to main.py

Line 135: to eliminate blank lines in the output using windows
with open(filename, 'w', newline='') as csvfile:

Line 140:

Module level execution section

if name == 'main':
main()

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

1 participant