【发布时间】:2019-05-10 21:20:59
【问题描述】:
似乎我无法让 pip 在我的计算机上安装 Cartopy。我直接从 Windows 命令行工作(没有 Anaconda 或其他代理程序)。
当我尝试“pip install cartopy”时,我得到了预期:
C:\Users\Justin\Documents\Python Programs>pip install cartopy
Collecting cartopy
Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
C:\Users\Justin\AppData\Local\Temp\pip-install-cetb0vj7\cartopy\setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
'.'.join(str(v) for v in GEOS_MIN_VERSION), ))
Proj 4.9.0 must be installed.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Justin\AppData\Local\Temp\pip-install-cetb0vj7\cartopy\
我知道“pip install proj”实际上并没有得到正确的模块版本,所以我去https://proj4.org/install.html下载并安装了我认为可以解决我的问题但似乎没有解决的OSGeo4W(作为参考,我仍然这样做虽然在我的电脑上有这个)。
然后我尝试直接从https://www.lfd.uci.edu/~gohlke/pythonlibs/#cartopy 网站安装 cartopy .whl 并尝试使用“pip install Cartopy-0.17.0-cp37-cp37m-win32.whl”(我使用 Python3 的 32 位版本。 7 所以我相当肯定这是正确的文件)。但是我得到了错误:
C:\Users\Justin\Documents\Python Programs>pip install Cartopy-0.17.0-cp37-cp37m-win32.whl
Processing c:\users\justin\documents\python programs\cartopy-0.17.0-cp37-cp37m-win32.whl
Requirement already satisfied: numpy>=1.10 in c:\users\justin\appdata\local\programs\python\python37\lib\site-packages (from Cartopy==0.17.0) (1.15.1)
Requirement already satisfied: setuptools>=0.7.2 in c:\users\justin\appdata\local\programs\python\python37\lib\site-packages (from Cartopy==0.17.0) (40.6.2)
Requirement already satisfied: six>=1.3.0 in c:\users\justin\appdata\local\programs\python\python37\lib\site-packages (from Cartopy==0.17.0) (1.11.0)
Collecting pyshp>=1.1.4 (from Cartopy==0.17.0)
Downloading https://files.pythonhosted.org/packages/08/3e/3bda7dfdbee0d7a22d38443f5cc8d154ff6d4701e615f4c07bf1ed003563/pyshp-2.0.1.tar.gz (214kB)
100% |████████████████████████████████| 215kB 1.4MB/s
Collecting shapely>=1.5.6 (from Cartopy==0.17.0)
Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Justin\AppData\Local\Temp\pip-install-sb4uyliy\shapely\setup.py", line 80, in <module>
from shapely._buildcfg import geos_version_string, geos_version, \
File "C:\Users\Justin\AppData\Local\Temp\pip-install-sb4uyliy\shapely\shapely\_buildcfg.py", line 200, in <module>
lgeos = CDLL("geos_c.dll")
File "c:\users\justin\appdata\local\programs\python\python37\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
然后我尝试下载一个名为 tar.gz 的文件,但这就是我迷失自己的地方。我对 tar.gz 不熟悉,我看到你必须“./configure”文件路径,但我不确定如何执行此操作,也不确定应该将所述文件存储在哪里。非常感谢您提供有关此问题的任何指导。
【问题讨论】:
-
安装Shapely。