7

I'm using Spyder with Anaconda and since MacOS last update (Big Sur 11.0.1), when doing import geopandas, I get the following error:

OSError: Could not find lib c or load any of its variants [].

There are several subjects on the matter (particularly this one and this one), that mainly recommends to reset the environment variable DYLD_FALLBACK_LIBRARY_PATH by putting in the Terminal:

export DYLD_FALLBACK_LIBRARY_PATH=$(HOME)/lib:/usr/local/lib:/lib:/usr/lib

However, here is what I get:

-bash: HOME: command not found

A brew or pip install didn't fix the problem either.

Does anyone have an idea on how I can fix this? Am I suppose to replace $(HOME) by something?

Many thanks!

clematologie
  • 177
  • 1
  • 9

3 Answers3

25

I had the same error and fixed it just by reinstalling Shapely:

pip install --upgrade --force-reinstall shapely
Kyle Barron
  • 2,452
  • 22
  • 17
4

I had the same issue. To fix the problem, use:

Change the Shapely package

https://github.com/Toblerity/Shapely/commit/a34ec59a7dc9089a71968c6871e29addd872ea3b

And then reinstall Xcode:

xcode-select --install

The geos.py file and line number you need to modify will be in the log output that generated the OSError. Just look a few lines up.

zerocog
  • 1,703
  • 21
  • 32
  • Thanks for the answer but what do you mean by change the Shapely package? How should I do that? – clematologie Nov 14 '20 at 13:55
  • You will need to look at your log in greater detail. I had the following information in my log. ./lib/python3.6/site-packages/shapely/geos.py", line 113, in free = load_dll('c').free .... modified this file per guidance of GitHub ref. – zerocog Nov 16 '20 at 02:23
0

For references: I ended up reinstalling a new environment on Anaconda an it works but I wasn't able to fix the original problem.

clematologie
  • 177
  • 1
  • 9