在 python 2.7 64 位上安装 cartopy 时出现 GEOSversion 错误

GEOSversion error when installing cartopy on python 2.7 64-bit

我从http://www.lfd.uci.edu/~gohlke/pythonlibs/下载了cartopy的.whl文件。使用命令行pip install cartopyETC.whl,提示安装成功。但是当我使用 import cartopy 测试它时,出现以下错误:

Using python in E:\Program Files Extra\Python27
2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)]

Traceback (most recent call last):
  File "C:\Users\KubiK\Desktop\SciPy2013-master\check_install.py", line 58, in <module>
    import_version('cartopy')
  File "C:\Users\KubiK\Desktop\SciPy2013-master\check_install.py", line 13, in import_version
    exec('from %s import __version__' % pkg)
  File "<string>", line 1, in <module>
  File "E:\Program Files Extra\Python27\lib\site-packages\cartopy\__init__.py", line 24, in <module>
    import shapely.speedups
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\speedups\__init__.py", line 3, in <module>
    from shapely.geometry import linestring, polygon
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\geometry\__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\geometry\base.py", line 9, in <module>
    from shapely.coords import CoordinateSequence
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\coords.py", line 8, in <module>
    from shapely.geos import lgeos
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\geos.py", line 137, in <module>
    geos_version_string, geos_version, geos_capi_version = _geos_version()
  File "E:\Program Files Extra\Python27\lib\site-packages\shapely-1.5.9-py2.7.egg\shapely\geos.py", line 124, in _geos_version
    GEOSversion = _lgeos.GEOSversion
  File "E:\Program Files Extra\Python27\lib\ctypes\__init__.py", line 378, in __getattr__
    func = self.__getitem__(name)
  File "E:\Program Files Extra\Python27\lib\ctypes\__init__.py", line 383, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'GEOSversion' not found
[Finished in 0.4s with exit code 1]
[shell_cmd: python -u "C:\Users\KubiK\Desktop\SciPy2013-master\check_install.py"]
[dir: C:\Users\KubiK\Desktop\SciPy2013-master]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Tcl\bin;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\Program Files Extra\Python27;E:\Program Files Extra\Python27\Scripts;C:\Tcl\bin;E:\Program Files Extra\Calibre2\;E:\Program Files Extra\Python34;E:\Program Files Extra\Python34\Scripts;C:\Program Files (x86)\Windows Kits.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript.0\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.2 & MySQL Utilities 1.5.2 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.2 & MySQL Utilities 1.5.2 1.5\Doctrine extensions for PHP\;E:\Program Files Extra\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\GDAL;C:\Program Files\Common Files\Microsoft Shared\Windows Live]

我更深入(和更长)地挖掘,并找到了这个页面。我卸载了 shapely(pip install shapely),而是从 http://www.lfd.uci.edu/~gohlke/pythonlibs/ pip 安装 shapely 的 .whl 文件。当我安装Cartopy的.whl文件后,好像问题解决了