简体   繁体   中英

cartopy: import cartopy.crs error

I'm working on some development for xarray . I was trying to install rasterio but it seems to have messed up my cartopy installation.

I installed rasterio on my mac using:

brew install gdal
pip install rasterio

Now when I try import cartopy.crs as ccrs I get the error

Invalid argument (must be a Polygon)
Geometry must be a Point or LineString
Assertion failed: (0 != cs), function GEOSCoordSeq_getSize_r, file geos_ts_c.cpp, line 3991.
Abort trap: 6

Possibly something with the paths/versions of GEOS , PROJ4 or GDAL changed?

Is there a way to do a clean installation of cartopy which will grab the dependencies?

I originally installed cartopy using conda install -c conda-forge cartopy . Doing conda update cartopy doesn't really do anything as I have the latest version.

Any help will be greatly appreciated as I do a large portion of my work with cartopy.

Edit: some discussion about this here https://github.com/SciTools/cartopy/issues/612

$ geos-config --version 3.6.2

Tried

conda remove xarray cartopy rasterio gdal geos proj4 shapely
conda install -c conda-forge xarray cartopy rasterio gdal geos proj4 shapely

but to no avail

cartopy was picking up the geos directory from the brew install gdal . I therefore removed this using:

$ brew tap beeftornado/rmtree
$ brew rmtree gdal
$ brew uninstall --ignore-dependencies proj
$ brew uninstall --ignore-dependencies geos
$ brew uninstall --ignore-dependencies json-c
$ brew uninstall --ignore-dependencies freexl
$ brew uninstall --ignore-dependencies liblwgeom

cartopy then correctly picked up the geos directory which is installed during the conda installation of cartopy .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM