无法安装Cartopy。

4

我正在使用PyCharm IDE,但无法安装“cartopy”模块。
当我在PyCharm终端中运行命令“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
  Getting requirements to build wheel ... error
  Complete output from command f:\python\python.exe f:\python\lib\site-packages\pip\_vendor\pep517\_in_process.py get_requires_for_build_wheel C:\Users\sagar\AppData\Local\Temp\tmpzriwmmff:
  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 "f:\python\python.exe f:\python\lib\site-packages\pip\_vendor\pep517\_in_process.py get_requires_for_build_wheel C:\Users\AppData\Local\Temp\tmpzriwmmff" failed with error code 1 in C:\Users\AppData\Local\Temp\pip-install-npt9snvs\cartopy

你是否已经安装了GEOS,版本是多少?https://trac.osgeo.org/geos/ - Cody Glickman
我已经从https://proj4.org/install.html#install在Windows上安装了它。 - Sagar Jogadia
检查GEOS版本,或安装最新版本。 - Mobrine Hayde
如何进行检查? - Sagar Jogadia
安装的GEOS似乎无法通过pip install与cartopy连接。您可能需要从源代码安装cartopy或在PyCharm中使用conda + conda-forge。您可以尝试手动将GEOS放入路径中,然后再尝试pip install。https://dev59.com/R2kw5IYBdhLWcg3w8fBJ - Cody Glickman
1个回答

0

Cartopy文档建议使用Conda(link):

conda install -c conda-forge cartopy

你也可以使用pip安装Cartopy,但是由于Cartopy有很多非Python依赖项(如Proj和GEOS),所以您必须单独安装它们。这很麻烦,容易出现像上面那样的错误。另一方面,Conda也可以为您处理这些非Python依赖项。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接