0
我從http://www.lfd.uci.edu/~gohlke/pythonlibs/下載了cartopy的.whl文件。使用命令行pip install cartopyETC.whl
,它表示安裝成功。但是當我使用import cartopy
測試,我得到了以下錯誤:在Python 2.7上安裝cartopy時出現GEOSversion錯誤64位
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\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\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]
雖然Christoph Gohlke的包裝可以單獨製作Windows安裝,但我相信在這一點上,社區貢獻的能力使conda成爲在Windows上安裝Python包的優秀工具。在windows上安裝cartopy會看起來像''conda install cartopy -c scitools''。 – pelson