Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find module (or one of its dependencies). Try using the full path with constructor syntax

When I run the command:

from shapely.geometry import LineString

I get this error:

Could not find module 'C:\Users\SWWB\Anaconda\Library\bin\geos_c.dll' (or one of its dependencies). Try using the full path with constructor syntax.

How can I solve it?

like image 808
Roger Avatar asked Dec 17 '20 17:12

Roger


Video Answer


2 Answers

I run into this same problem. I am using Pycharm on Windows 10 with a conda environment. I used pip to install the packages in my requirements.txt file.

I am using Shapely which depends on geos. It seems pip did not install that dependency, so what I did was to first remove Shapely with:

pip uninstall shapely

Then, I used conda to install the package (geos gets installed too), and everything works fine.

conda install shapely

I think if you use pip, you can just install geos individually if it is not installed (I did not test):

pip install geos
like image 50
Ahmed Ktob Avatar answered Oct 11 '22 17:10

Ahmed Ktob


I had similar problem. I reinstalled shapely using conda.

Use the following

conda install shapely
like image 2
SJa Avatar answered Oct 11 '22 17:10

SJa