3

I'm having trouble with geos lib in python. I'm using an anaconda venv with Python 3.6 on Windows 10. On one computer, it is running. So I exported the venv and installed the venv on another computer (which worked). But on the other computer, the same code is not running. I'm using geos 3.8.0 and shapely 1.6.4. When I run the code, I get the following error:

*File "..\lib\site-packages\shapely\coords.py", line 8, in <module>
    from shapely.geos import lgeos
  File "..\lib\site-packages\shapely\geos.py", line 130, in <module>
    os.path.join(sys.prefix, "Library", "lib", "geos_c.dll"),
  File "..\lib\site-packages\shapely\geos.py", line 56, in load_dll
    libname, fallbacks or []))
OSError: Could not find lib geos_c.dll or load any of its variants ['..\\Library\\lib\\geos_c.dll']*

I already tried:

  • to reinstall the packages with conda-forge
  • use other versions e.g.: geos 3.7.1 and shapely 1.7.0
  • copied the geos_c.dll from ..\Library\bin (where it actually exists) to \Library\lib\
  • changed the os.path.join in geos.py to os.path.join(sys.prefix, "Library", "bin", "geos_c.dll")

Does anyone know, how to fix this problem so that I can run the code on both computers?

Thanks in advance!

PHOFF
  • 51
  • 1
  • 3
  • 1
    Does this answer your question? [Could not find library geos\_c or load any of its variants](https://stackoverflow.com/questions/19742406/could-not-find-library-geos-c-or-load-any-of-its-variants) – Georgy Apr 20 '20 at 18:00
  • No, unfortunately not. First it is about Fedora and not Windows. Second, the actual installation is actually working. But somehow, it is not possible shapely is not able to find/open geos_c.dll – PHOFF Apr 21 '20 at 08:10

3 Answers3

2

I got rid of the problem with installing the packages geos and shapely at base environment in anaconda. Maybe it helps someone else

PHOFF
  • 51
  • 1
  • 3
  • I think it would be better if you posted this as an answer under the duplicate question I linked in the comment. It will be much easier for people to find this information then. If you do so, you could also delete this question. – Georgy Apr 21 '20 at 11:05
0

I tried using conda-forge, but it didn't work. However, it worked from the anaconda prompt after installing Node.js

0

Make sure you have the VC_redist_x64.exe (or your equivalent) installed. Apparently geos_c.dll users C+ elements.