microsoft / lida

Automatic Generation of Visualizations and Infographics using Large Language Models
https://microsoft.github.io/lida/
MIT License
2.66k stars 282 forks source link

Mac installation error: geos_c.h not found #19

Closed ajduberstein closed 12 months ago

ajduberstein commented 12 months ago

I suspect a number of Mac users will run into a GEOS issue on pip install lida

      src/_geoslib.c:751:10: fatal error: 'geos_c.h' file not found
      #include "geos_c.h"
               ^~~~~~~~~~
      1 warning and 1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  ERROR: Failed building wheel for basemap

This fixes the problem in my case:

brew install geos
export CPPFLAGS="-I/opt/homebrew/include"
export LDFLAGS="-L/opt/homebrew/lib"
pip install basemap
pip install lida

It may be helpful to include some mention of this in the docs or make the inclusion of basemap optional.

Context

Running Mac OS 13.2.1, Python 3.10.5

victordibia commented 12 months ago

Thanks for sharing this. I'll try to reproduce. In the mean time, basemap is not a required dependency, so you can modify [pyproject.toml](https://github.com/microsoft/lida/blob/main/pyproject.toml) to remove it and then install from source pip install -e . in the project root.

Overall, I'll make it an optional dependency, thanks again!

victordibia commented 12 months ago

Thanks again @ajduberstein

I just updated the library to optionally install basemap e.g.pip install lida[tools].
So going forward, basemap should not be required. (basemap is only needed when lida suggests visualization code that includes maps).

pip install lida==0.0.8