Windows 64上的Python,GEOS和Shapely [英] Python, GEOS and Shapely on Windows 64
问题描述
当尝试在Windows 64位计算机上安装Shapely时,无法使GEOS库正常工作.
When trying to install Shapely on my Windows 64bit computer, I cannot get the GEOS library to work.
到目前为止,我已经运行了OSGeo4W安装程序,并从中安装了GDAL(我相信该软件包中包含geos库).之后,我检查了C:\OSGeo4W\bin
目录中是否有geos_c.dll,但是我错过了一些配置步骤,或者该库不起作用.
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.
我需要Shapely才能工作,因此我在安装GDAL之后也运行了pip install shapely
,它显然可以工作(尽管找不到GEOS的C库).
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).
在我的代码中,我可以导入Shapely,但是当我尝试使用它时,出现一条错误消息,告诉我"geos.dll"
未找到.
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!
推荐答案
从2020年开始,推荐的安装Shapely的方法很简单:
As of 2020, the recommended way to install Shapely is simply:
pip install shapely
(当将二进制车轮添加到PyPi时,您可能需要--upgrade
至少获得1.7.0版)
(you may need --upgrade
to get at least version 1.7.0, when binary wheels were addeed to PyPi)
Anaconda 是安装预编译Python软件包的流行资源.可以从几个主要渠道中获得针对Win-64的Shape .如果您需要大量最新的Python软件,并且很高兴使用第三方供应商提供的Python,则建议使用此方法.
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.
Miniconda 相似,但下载/安装的体积小得多(因为它在基本安装中捆绑的软件包不多.)
Miniconda is similar, except much smaller to download/install (as it doesn't bundle as many packages in the base install).
连同这些:
conda install shapely
Christoph Gohlke是python.org上安装了Python的Windows用户的另一资源,它为Python维护了极好的非官方Windows二进制文件池.下载用于32位或64位版本的Python的 Shapely wheel ,其中包括GEOS依赖项.
Another resource 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.
这篇关于Windows 64上的Python,GEOS和Shapely的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!