-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSX: pip install of shapely does not work with geos #416
Comments
@MarkWieczorek thanks for the report. Can you tell me which version of Shapely you have here? The Shapely binary wheels for macosx that I uploaded to PyPI probably won't work well with cartopy unless the version is >= 1.5.16. |
The version that is downloaded from pip is 1.5.17.
|
Broadly speaking, the problem is DLL Hell. You've built cartopy with one version of GEOS and Shapely's binaries are built with another version of GEOS (maybe the same release, but configured and compiled differently). The extension modules in the two packages are not compatible. Import Shapely first and cartopy isn't able to use the GEOS dynamic library that Shapely caused to be loaded. I could strive to make Shapely more compatible, and will, but there are limits to this and lots of different ways that users install GEOS on their systems: macports, Homebrew, the Kyngchaos installers. Being compatible with all of them would be difficult, especially since I have no great expertise with dynamic linking on OS X. Bundling GEOS into the macosx Shapely wheels has so many benefits for developers that I don't want to abandon it. The workaround is to install Shapely with Projects like cartopy can specify
in a pip requirements file to help out. I also expect that conda users aren't going to have this DLL problem as long as conda package developers do the right thing. Longer term, I wonder if cartopy shouldn't move its GEOS dependency entirely to Shapely or vendorize Shapely in order to ensure extension module compatibility. Next for me:
|
See also #553. |
Installing shapely via pip on OSX, and then try to use a routine in cartopy that relies on shapely results in the following error and kernel crash:
The can be fixed by installing shapely with the
no-binary
flagThe text was updated successfully, but these errors were encountered: