geos assertion failure

933 views
Skip to first unread message

Julien Chastang

unread,
Apr 29, 2014, 7:15:59 PM4/29/14
to scitoo...@googlegroups.com

Group,

I am starting to get back into Cartopy after an absence of a few months. I've decided to use the conda package manager for the installation of Cartopy. (Rich Signell gave me some help with this.) The installation seems to have gone smoothly and I am able to import cartopy without problems. However, when I try a simple example like this one:

http://scitools.org.uk/cartopy/docs/latest/examples/features.html

My kernel dies with this message:

WARNING:root:kernel 4752945a-ecac-4deb-8f97-68001a23d419 restarted

Assertion failed: (0 != cs), function GEOSCoordSeq_getSize_r, file geos_ts_c.cpp, line 3530.

I am running OS X 10.7.5.

Has anyone else run into this assertion failure? Any advice on how I can get around this?

Thanks.

-Julien

rsignell

unread,
Apr 30, 2014, 5:26:36 PM4/30/14
to scitoo...@googlegroups.com
Julien,
I think there might have been a problem with the version of geos -- loading the older version from anaconda instead of the one you built.  I added geos >=3.4.2 into my conda recipe for shapely and cartopy now works on my mac.

Can you try this?

conda remove geos shapely cartopy

conda install -c rsignell cartopy

and see if you still have the problem?

-Rich

Julien Chastang

unread,
May 1, 2014, 1:52:46 PM5/1/14
to scitoo...@googlegroups.com
Rich,

Thanks for your help. Those commands worked after doing some initial cleanup. Long story short, I deleted a ton of Python related cruft (including geos, etc.) on my computer. I nuked brew and EPD related installations. Then I re-installed conda, and now cartopy works. Maybe this was overkill, but at least it works now.

I can now see the future (or the present) where conda can solve a lot of setup/installation headaches. Simply having to do conda install cartopy is very nice indeed. That's progress.

-Julien

Stephan Hoyer

unread,
Aug 1, 2014, 1:35:27 AM8/1/14
to scitoo...@googlegroups.com
Hi Richard,

I'm encountering the same issue as Julien here with trying to install your cartopy conda package.

In a fresh conda environment with only the default conda channel enabled, Conda to install geos 3.3.3 along with cartopy, and then I get almost an identical error message I try to run this example:

I've also tried building each of the conda packages (including geos and shapely) myself from your recipes on github:

They all claim to build successfully, but the example script still dies at the same place.

Any ideas?

Thanks,
Stephan

esc24

unread,
Sep 1, 2014, 5:19:58 AM9/1/14
to scitoo...@googlegroups.com
Hi,

I hit the same issue. I believe the problem lies with shapely. If you import shapely.geos then print shapely.geos._lgeos you'll see something like:

<CDLL '/usr/local/lib/libgeos_c.dylib', handle 10042b150 at 10216a090>


This is not the version installed by conda. Any ideas, other than removing the other version?


Ed

Stephan Hoyer

unread,
Sep 15, 2014, 7:02:23 PM9/15/14
to scitoo...@googlegroups.com
Hi Ed,

Good tip! It looks like the issue is we already have geos installed (e.g., from brew), which shapely is preferring to the conda geos. The fix requires an awkward patch, but it's doable with conda.

Here are fixed recipes for Cartopy that work for me on OS X (and Ubuntu):

Binaries (for OS X) are in my Binstar account:

Cheers,
Stephan

Piyush Jain

unread,
Dec 4, 2017, 7:52:26 PM12/4/17
to Iris
I'm also experiencing this same issue - more than 3 years later (macos Sierra, with anaconda 2 installation). 

Installing from rsignell doesn't work for me. 

How do I install the patches mentioned by Stephan?

Thanks,
Piyush
Reply all
Reply to author
Forward
0 new messages