栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

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

【Cartopy】安装失败解决方案
  • pip install Cartopy报错
  • 采用whl包安装后报错
  • 解决分析
    • 依赖包卸载
    • 正确包安装
    • 问题解决

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
问题解决

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/938077.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号