Python, GEOS and Shapely on Windows 64

混江龙づ霸主 提交于 2019-12-17 19:32:52

问题


When trying to install Shapely on my Windows 64bit computer, I cannot get the GEOS library to work.

So far, I have run the OSGeo4W installer from which I installed GDAL (I believe the geos library is included in that package). After that, I checked and I have geos_c.dll on my C:\OSGeo4W\bin directory, but either I have missed some configuration steps or the library does not work.

I need Shapely to work, so I also ran pip install shapely after installing GDAL, and it apparently worked (although it could not find the C library for GEOS).

In my code, I can import Shapely, but when I try to use it, I get an error telling me "geos.dll" is not found.

Any help with this will be very appreciated. Thanks!


回答1:


For Windows users with Python installed from python.org, Christoph Gohlke maintains an excellent pool of Unofficial Windows Binaries for Python. Download the Shapely wheels for 32- or 64-bit versions of Python, which includes GEOS dependencies.


Anaconda is a popular resource to install precompiled Python packages. Shapely for win-64 is available from several of the main channels. This is a recommended method if you require lots of up-to-date Python software, and are happy to use Python from a 3rd party vendor.





回答2:


see my answer here https://stackoverflow.com/a/50623996/1683626

on windows 10, python 3.6.5 64bit

  • install osgeo4w
  • add installed folder to path e.g. C:\OSGeo4W64\bin (must contain geos_c.dll)
  • restart command line



回答3:


There is an version of Shapely available here that includes geos in the installer. Look at the bottom of the page.




回答4:


I used the command below and it did work;

pip install Shapely==1.3.0



来源:https://stackoverflow.com/questions/13144158/python-geos-and-shapely-on-windows-64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!