h3-py: Problem importing h3

When importing h3 like in the documentation by doing: from h3 import h3 I get the following error:

OSError: dlopen(/Users/johannesh/anaconda3/envs/on_demand_mobility_nyc_taxi_rides/lib/python3.7/site-packages/h3/out/libh3.1.dylib, 6): image not found

This also happens for a normal pip install --user installation. I looked in the location, and the /h3/out folder does indeed not exist. I’m not sure what this means, or what exactly is going wrong. Seems to be something during installation?

macOS 10.13.6 python 3.7

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Yes that was the issue. I installed cmake and then uninstalled h3 and deleted the pip cache. After that the installation worked properly.

Thank you all for your help. I’m looking forward to using h3 for binning geo coordinates, instead of geohashs. It seems a lot more optimal 👍.

I am having exactly the same problem when using pipenv to install h3. I do have however the compiler tools in my $PATH:

- which cc
/usr/bin/cc
- which make
/Applications/Xcode.app/Contents/Developer/usr/bin/make
- which cmake
/usr/local/bin/cmake

When I install h3 from my project (pipenv) environment, it does install it successfully but /out directory is empty and obviously the needed libh3.1.dylib is not available.

OSError: dlopen(/Users/rodrigo/.local/share/virtualenvs/myproject--NqKkPOW/lib/python3.7/site-packages/h3/out/libh3.1.dylib, 6): image not found

Any ideas?

I was having the same issue. Here are the steps that worked for me. 1: Installed cmake using brew. 2: in the virtual environment, a) pip uninstall h3. b) removed pip cache (/Users/*/Library/Caches/pip) 3: redo: pip install h3

We need to update the README to call out the make and cmake dependencies for the package. Can you install cmake (through brew or however you manage your Mac) and see if that fixes things?