【问题标题】:Cannot install cartopy无法安装cartopy
【发布时间】:2019-08-12 17:13:05
【问题描述】:

我正在使用 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 以及什么版本? trac.osgeo.org/geos
  • 我已经从proj4.org/install.html#install将它安装在windows上
  • 检查 GEOS 版本,或安装最新版本
  • 如何检查?
  • 安装的 GEOS 似乎没有通过 pip 安装连接到 cartopy。您可能需要从源代码安装 cartopy 或在 PyCharm 中使用 conda + conda-forge。您可能想尝试手动将 GEOS 放入您的路径,然后尝试 pip install stackoverflow.com/questions/9546324/…

标签: python cartopy proj


【解决方案1】:

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

conda install -c conda-forge cartopy

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-08-24
    • 1970-01-01
    • 2022-06-14
    • 2020-06-13
    • 2023-02-15
    • 1970-01-01
    • 1970-01-01
    • 2014-03-24
    相关资源
    最近更新 更多