4

Right now I have the following code which crashes with segfault:

from shapely import geometry

print(geometry.Polygon([[0, 0], [0, 1], [1, 1], [1, 0]]))

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

I tried reinstalling shapely with python3.7 -m pip install -U shapely --no-cache but nothing works. My environment is Ubuntu 18.04 and Python 3.7 outside any virtual environment. Thus other questions about installing shapely into anaconda environment don't help me. Any suggestions on how to make shapely work?

sanyassh
  • 8,100
  • 13
  • 36
  • 70

1 Answers1

5

According to this issue on GitHub this problem can appear when you have "mixed versions of the libgeos from your system and a pre-compiled Shapely".

Running the following command should resolve the issue:

pip uninstall shapely; pip install --no-binary :all: shapely
Georgy
  • 12,464
  • 7
  • 65
  • 73