DahnJ / H3-Pandas

Integration of H3 with GeoPandas and Pandas
http://h3-pandas.readthedocs.io/
MIT License
207 stars 19 forks source link

Cannot import h3 from h3 #33

Open ioalexei opened 4 days ago

ioalexei commented 4 days ago

I've started getting an error importing h3pandas:

import h3pandas 
>>  File "/path/.venv/lib/python3.12/site-packages/h3pandas/h3pandas.py", line 11, in <module>

>>from h3 import h3
>>ImportError: cannot import name 'h3' from 'h3' (/path/.venv/lib/python3.12/site-packages/h3/__init__.py)

Edit: Python version 3.12.3 h3 4.1.2 h3pandas 0.2.6

sankalpsharmaa commented 2 days ago

I get the same error

ajfriend commented 1 day ago

This is because we've updated the API in h3-py in v4. In general, when you're upgrading from v3 to v4, any occurrences of from h3 import h3 can be replaced with import h3.

Just note that most of the function names have changed to align with the renaming that happened in the core library. See the new API here: https://uber.github.io/h3-py/api_quick.html

In the short term, you can pin h3 < 4 to avoid this error.