uber / h3-py

Python bindings for H3, a hierarchical hexagonal geospatial indexing system
https://uber.github.io/h3-py
Apache License 2.0
815 stars 130 forks source link

ModuleNotFoundError: No module named 'h3._cy.cells' #377

Closed marklit closed 4 months ago

marklit commented 4 months ago
$ pip install -e 'git+https://github.com/uber/h3-py@v4#egg=h3'
Successfully installed h3-4.0.0
$ ipython
import h3
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 6
      4 import geopandas as gpd
      5 from   geopy.geocoders import Nominatim
----> 6 import h3
      7 import highspy
      8 import networkx as nx

File ~/.highs/src/h3/src/h3/__init__.py:3
      1 # flake8: noqa
----> 3 from .api.basic_str import *
      4 from ._version import __version__
      6 from ._cy import (
      7     UnknownH3ErrorCode,
      8     H3BaseException,
   (...)
     28     H3OptionInvalidError,
     29 )

File ~/.highs/src/h3/src/h3/api/__init__.py:3
      1 # flake8: noqa
----> 3 from . import basic_int
      4 from . import basic_str
      5 from . import memview_int

File ~/.highs/src/h3/src/h3/api/basic_int/__init__.py:3
      1 # This file is **symlinked** across the APIs to ensure they are exactly the same.
----> 3 from ... import _cy
      4 from ..._h3shape import (
      5     H3Shape,
      6     H3Poly,
   (...)
      9     h3shape_to_geo,
     10 )
     12 from ._convert import (
     13     _in_scalar,
     14     _out_scalar,
     15     _in_collection,
     16     _out_collection,
     17 )

File ~/.highs/src/h3/src/h3/_cy/__init__.py:16
      1 # flake8: noqa
      3 """
      4 This module should serve as the interface between the C/Cython code and
      5 the Python code. That is, it is an internal API.
   (...)
     13 function interface and input conversion (string to int, for instance).
     14 """
---> 16 from .cells import (
     17     is_valid_cell,
     18     is_pentagon,
     19     get_base_cell_number,
     20     get_resolution,
     21     cell_to_parent,
     22     grid_distance,
     23     grid_disk,
     24     grid_ring,
     25     cell_to_children,
     26     compact_cells,
     27     uncompact_cells,
     28     get_num_cells,
     29     average_hexagon_area,
     30     cell_area,
     31     grid_path_cells,
     32     is_res_class_iii,
     33     get_pentagons,
     34     get_res0_cells,
     35     cell_to_center_child,
     36     get_icosahedron_faces,
     37     cell_to_local_ij,
     38     local_ij_to_cell,
     39 )
     41 from .edges import (
     42     are_neighbor_cells,
     43     cells_to_directed_edge,
   (...)
     50     edge_length,
     51 )
     53 from .latlng import (
     54     latlng_to_cell,
     55     cell_to_latlng,
   (...)
     60     great_circle_distance,
     61 )

ModuleNotFoundError: No module named 'h3._cy.cells'
marklit commented 4 months ago

I ran this instead and it gave me the latest beta.

$ pip install -U h3 --pre
In [4]: h3.versions()
Out[4]: {'c': '4.0.0', 'python': '4.0.0b5'}