Skip to content

Shapely mismatchs with system geos library when geos-3.7  #651

Closed

Description

@cocconat

I am developing a project which uses both Shapely and libgeos, I create shapes with 'shapely', pass with Cython to C++ library and process them with 'libgeos' in C++.

##Description of the issue

After last libgeos upgrade I had this trouble:

Shapely install by its own 2 files in this path:

ls <my_path>lib/python3.7/site-packages/shapely/.libs
libgeos-3-6a255356.6.2.so
libgeos_c-bd8d3f16.so.1.10.2

thess files override the system libgeos:
geos-config --version
3.7.0

and cause segfault like this:
Thread 1 "python" received signal SIGSEGV, Segmentation fault. 0x00007fffea6abe78 in vtable for _cxxabiv1::_class_type_info () from /usr/lib/libstdc++.so.6
(gdb) bt

#0 0x00007fffea6abe78 in vtable for _cxxabiv1::_class_type_info () from /usr/lib/libstdc++.so.6

#1 0x00007fffd717a0e2 in geos::geom::LineString::apply_rw(geos::geom::CoordinateSequenceFilter&) () from /home/cocco/.virtualenvs/dense_project/lib/python3.7/site-packages/shapely/.libs/./libgeos-3-6a255356.6.2.so

#2 0x00007fffd717d66d in geos::geom::Polygon::apply_rw(geos::geom::CoordinateSequenceFilter&) () from /home/cocco/.virtualenvs/dense_project/lib/python3.7/site-packages/shapely/.libs/./libgeos-3-6a255356.6.2.so

#3 0x00007fffd27f8f84 in geos::geom::util::ComponentCoordinateExtracter::getCoordinates(geos::geom::Geometry const&, std::vector<geos::geom::Coordinate const*, std::allocator<geos::geom::Coordinate const*> >&) () from /usr/lib/libgeos-3.7.0.so

#4 0x00007fffd27fc6c5 in geos::geom::prep::BasicPreparedGeometry::BasicPreparedGeometry(geos::geom::Geometry const*) () from /usr/lib/libgeos-3.7.0.so

Steps to reproduce the problem.

I have not been able to reproduce the problem in OSX, the problem arises when Shapely install those files and the system version is not 3.6x.

Operating system

I am running Arch Linux but installing in virtualenv via pip

Shapely version and provenance

'1.6.4.post2' installed from PyPI using pip

Activity

  1. sgillies commented on Oct 31, 2018

    @sgillies
    Contributor

    The Shapely wheels on PyPI contain their own version of GEOS and you will need to avoid them by using pip's --no-binary option:

    pip install --no-binary shapely shapely

    (yes, "shapely" twice, the first is the value for the --no-binary option.)

    This will install a shapely package which has extension modules linked against your system GEOS library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions