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

error while import get_data() from loaders #49

Open
khatamirock opened this issue Nov 20, 2023 · 1 comment
Open

error while import get_data() from loaders #49

khatamirock opened this issue Nov 20, 2023 · 1 comment

Comments

@khatamirock
Copy link

this error is happening
`ImportError Traceback (most recent call last)
in <cell line: 7>()
5
6 import numpy as np
----> 7 from nlpia.loaders import get_data
8 from sklearn.decomposition import PCA
9

1 frames
/usr/local/lib/python3.10/dist-packages/pugnlp/util.py in
45 import warnings
46 from traceback import print_exc
---> 47 from collections import OrderedDict, Mapping, Counter
48 from itertools import islice
49 from decimal import Decimal, InvalidOperation, InvalidContext

ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/init.py)


NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.`

@Billy-06
Copy link

Billy-06 commented Apr 2, 2024

Got the same error as you did I've show the screen shots below, Hopefully you find them helpful.
This is the error I got, similar to yours

image
It shows that it's due to importing the Mapping class from the wrong library
image

Change the import such that Mapping is imported from collections.abc
from collections.abc import Mapping
image

After fixing that you may or may not get a second error as the one below
image

Much like the first one, it indicates that mapping has been imported from the wrong library.

image

Adjust it like you did the previous one as follows
from collections.abc import Mapping
image

Hopefully this helps. Thanks

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

2 participants