Question

I downloaded Shapely to do some polygon work (on a Ubuntu AWS instance). Everything installed just fine, I used wget. I also did pip when I first encountered the error I'm about to explain, but it just said everything was there, so I don't think the download is the issue.

Anyway, when I try to import anything from shapely, I get this error:

OSError: libgeos_c.so: cannot open shared object file: No such file or directory

When I just say "import shapely", it all goes fine. However, when I need to import anything from deeper in the library, it crashes. I first tried it with from shapely.geometry import polygon but it's the same for anything from within the package. Has anyone had this problem before/know the solution?

Was it helpful?

Solution

On Ubuntu, apparently you're always supposed to use sudo apt-get install to get libraries and such. When I did wget or pip install, I was just sticking the files in a random spot, not in my actual path.

So, I guess always use sudo apt-get install...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top