[Python] ImportError: cannot import name 'h3' from 'h3' while importing h3pandas in Colab for...

Discussão em 'Python' iniciado por Stack, Outubro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I have Colab project that uses h3pandas for polyfill, but importing h3pandas throws an ImportError.

    After adding these libraries:

    !pip install h3pandas
    import pandas as pd
    import matplotlib.pyplot as plt
    import h3pandas


    I get this error:

    ImportError Traceback (most recent call last)
    <ipython-input-2-5e53e9308d98> in <cell line: 3>()
    1 import pandas as pd
    2 import matplotlib.pyplot as plt
    ----> 3 import h3pandas

    1 frames
    /usr/local/lib/python3.10/dist-packages/h3pandas/h3pandas.py in <module>
    9 import geopandas as gpd
    10
    ---> 11 from h3 import h3
    12 from pandas.core.frame import DataFrame
    13 from geopandas.geodataframe import GeoDataFrame`

    ImportError: cannot import name 'h3' from 'h3' (/usr/local/lib/python3.10/dist-packages/h3/__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.

    Continue reading...

Compartilhe esta Página