openeventdata / mordecai

Full text geoparsing as a Python library
MIT License
738 stars 97 forks source link

AttributeError: module 'collections' has no attribute 'Mapping' #110

Closed veterinarian-5300 closed 1 year ago

veterinarian-5300 commented 1 year ago

Hello brother hope you doing great, I want you to know no issues in life are permanent, and its okay to take help. Here I am with a temporary issue, I installed mordecai following all the instructions, made a python virtual environment, pullled a docker image but after everything I facing this error, I would really appreciate if I can get any help.

(detect) J:\Projects\geonames>python app.py Models path: J:\Projects\geonames\detect\lib\site-packages\mordecai\models\ Traceback (most recent call last): File "J:\Projects\geonames\app.py", line 4, in <module> mordecai_obj = mordecai.Geoparser() File "J:\Projects\geonames\detect\lib\site-packages\mordecai\geoparse.py", line 50, in __init__ self.conn = utilities.setup_es(es_hosts, es_port, es_ssl, es_auth) File "J:\Projects\geonames\detect\lib\site-packages\mordecai\utilities.py", line 260, in setup_es S = Search(using=CLIENT, index="geonames") File "J:\Projects\geonames\detect\lib\site-packages\elasticsearch_dsl\search.py", line 228, in __init__ super(Search, self).__init__(**kwargs) File "J:\Projects\geonames\detect\lib\site-packages\elasticsearch_dsl\search.py", line 96, in __init__ elif isinstance(doc_type, collections.Mapping): AttributeError: module 'collections' has no attribute 'Mapping'

I am working on python version 3.10 And here are all the libs i have installed,

(detect) J:\Projects\geonames>pip freeze absl-py==1.4.0 astunparse==1.6.3 blis==0.7.9 cachetools==5.3.0 catalogue==1.0.2 certifi==2022.12.7 charset-normalizer==3.0.1 colorama==0.4.6 cymem==2.0.7 editdistance==0.6.2 elasticsearch==5.4.0 elasticsearch-dsl==5.3.0 en-core-web-lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-2.3.1/en_core_web_lg-2.3.1.tar.gz flatbuffers==23.1.21 frozendict==2.3.5 gast==0.4.0 google-auth==2.16.1 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 grpcio==1.51.3 h5py==3.8.0 idna==3.4 keras==2.11.0 libclang==15.0.6.1 Markdown==3.4.1 MarkupSafe==2.1.2 mordecai==2.1.0 murmurhash==1.0.9 numpy==1.24.2 oauthlib==3.2.2 opt-einsum==3.3.0 packaging==23.0 pandas==1.5.3 plac==1.1.3 preshed==3.0.8 protobuf==3.19.6 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 pytz==2022.7.1 requests==2.28.2 requests-oauthlib==1.3.1 rsa==4.9 six==1.16.0 spacy==2.3.9 srsly==1.0.6 tensorboard==2.11.2 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorflow==2.11.0 tensorflow-estimator==2.11.0 tensorflow-intel==2.11.0 tensorflow-io-gcs-filesystem==0.30.0 termcolor==2.2.0 thinc==7.4.6 tqdm==4.64.1 typing_extensions==4.5.0 urllib3==1.26.14 wasabi==0.10.1 Werkzeug==2.2.3 wget==3.2 wrapt==1.14.1

veterinarian-5300 commented 1 year ago

Good heavens, I found a solution, it works with python version 3.9, this love from chatgpt