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' #379

Open
dave-messenger-cbre opened this issue May 15, 2024 · 0 comments
Open

Comments

@dave-messenger-cbre
Copy link

I wanted to try the Python client to interact with Infoblox but immediately hit an issue. The client imports an additional package (requests) which then imports another (urllib3) that tries to import modules from the collections package. This package has since changed the location of the files to import and then fails with a traceback.

Trying to upgrade the urllib3 package to the latest version also doesn't help as the requirement within the infoblox-client package is for an older release.

Traceback (most recent call last):
File "/home/dave/scripts/infoblox-create/./infoblox-create.py", line 3, in
from infoblox_client import connector
File "/home/dave/.local/lib/python3.10/site-packages/infoblox_client/connector.py", line 19, in
import requests
File "/home/dave/.local/lib/python3.10/site-packages/requests/init.py", line 43, in
import urllib3
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/init.py", line 8, in
from .connectionpool import (
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 29, in
from .connection import (
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/connection.py", line 39, in
from .util.ssl_ import (
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/util/init.py", line 3, in
from .connection import is_connection_dropped
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/util/connection.py", line 3, in
from .wait import wait_for_read
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/util/wait.py", line 1, in
from .selectors import (
File "/home/dave/.local/lib/python3.10/site-packages/urllib3/util/selectors.py", line 14, in
from collections import namedtuple, Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)

Reference:
https://stackoverflow.com/questions/69381312/importerror-cannot-import-name-from-collections-using-python-3-10/69727802#69727802

I wanted to highlight this issue for resolution.

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