【Cartopy】安装失败解决方案,一定可行

pip install Cartopy报错

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting cartopy
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f6/55/1e1c737dc9436b320deead73d1c455ddbb74b8b6992081863492f6f6378a/Cartopy-0.20.2.tar.gz (10.8 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

  error: subprocess-exited-with-error
  
  Getting requirements to build wheel did not run successfully.
  exit code: 1
  
  [3 lines of output]
  setup.py:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or later installed, or installation may fail.
    warnings.warn(
  Proj 8.0.0 must be installed.
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

采用whl包安装后报错

ImportError: DLL load failed while importing trace: 找不到指定的模块

解决分析

cartopy和依赖包的版本冲突问题

依赖包卸载

pip uninstall cartopy

pip uninstall Pillow

pip uninstall pyshp

pip uninstall Shapely

pip uninstall pyproj

正确包安装

登录https://www.lfd.uci.edu/~gohlke/pythonlibs/,找到对应自己python版本现有最高版本的安装包,例如我的python版本是3.8,平台为64位windows,则选择下载:

Pillow-9.1.1-cp38-cp38-win_amd64.whl
Shapely-1.8.2-cp38-cp38-win_amd64.whl
pyproj-3.3.1-cp38-cp38-win_amd64.whl
pyshp-2.3.0-py2.py3-none-any.whl
Cartopy-0.20.2-cp38-cp38-win_amd64.whl

下载后利用pip进行安装:

pip install Pillow-9.1.1-cp38-cp38-win_amd64.whl
pip install Shapely-1.8.2-cp38-cp38-win_amd64.whl
pip install pyproj-3.3.1-cp38-cp38-win_amd64.whl
pip install pyshp-2.3.0-py2.py3-none-any.whl
pip install Cartopy-0.20.2-cp38-cp38-win_amd64.whl

问题解决

在这里插入图片描述

评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值