使用pip安装Cartopy库时,出现报错Getting requirements to build wheel did not run successfully.
使用pip安装Cartopy库时,出现报错:Getting requirements to build wheel did not run successfully.
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.
输入:
pip install Cartopy
报错:
D:\app\python\python310\Scripts>pip install Cartopy
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
Collecting Cartopy
Using cached Cartopy-0.20.2.tar.gz (10.8 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... 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.
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
于是,尝试在https://www.lfd.uci.edu/~gohlke/pythonlibs/#numba下载并安装whl文件:
输入:
pip install Cartopy-0.20.2-pp38-pypy38_pp73-win_amd64.whl
出现成功安装提示:
D:\app\python\python310\Scripts>pip install Cartopy-0.20.2-cp310-cp310-win_amd64.whl
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
Processing d:\app\python\python310\scripts\cartopy-0.20.2-cp310-cp310-win_amd64.whl
Collecting shapely>=1.6.4
Downloading Shapely-1.8.1.post1-cp310-cp310-win_amd64.whl (1.3 MB)
---------------------------------------- 1.3/1.3 MB 2.2 MB/s eta 0:00:00
Requirement already satisfied: pyshp>=2.1 in d:\app\python\python310\lib\site-packages (from Cartopy==0.20.2) (2.2.0)
Requirement already satisfied: numpy>=1.18 in d:\app\python\python310\lib\site-packages (from Cartopy==0.20.2) (1.22.0)
Requirement already satisfied: matplotlib>=3.1 in d:\app\python\python310\lib\site-packages (from Cartopy==0.20.2) (3.5.1)
Requirement already satisfied: pyproj>=3.0.0 in d:\app\python\python310\lib\site-packages (from Cartopy==0.20.2) (3.3.0)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (1.3.2)
Requirement already satisfied: cycler>=0.10 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (0.11.0)
Requirement already satisfied: packaging>=20.0 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (21.3)
Requirement already satisfied: pillow>=6.2.0 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (9.0.0)
Requirement already satisfied: python-dateutil>=2.7 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (2.8.2)
Requirement already satisfied: fonttools>=4.22.0 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (4.28.5)
Requirement already satisfied: pyparsing>=2.2.1 in d:\app\python\python310\lib\site-packages (from matplotlib>=3.1->Cartopy==0.20.2) (3.0.6)
Requirement already satisfied: certifi in d:\app\python\python310\lib\site-packages (from pyproj>=3.0.0->Cartopy==0.20.2) (2021.10.8)
Requirement already satisfied: six>=1.5 in d:\app\python\python310\lib\site-packages (from python-dateutil>=2.7->matplotlib>=3.1->Cartopy==0.20.2) (1.16.0)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
Installing collected packages: shapely, Cartopy
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
Successfully installed Cartopy-0.20.2 shapely-1.8.1.post1
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (d:\app\python\python310\lib\site-packages)
但是,在pycharm中导入cartopy模块时,出错:
ImportError: DLL load failed: 找不到指定的模块。
网上查找资料后,原因应该是cartopy模块的依赖库版本不对。
解决方案
cartopy包的依赖库有:pyproj,Pillow,pyshp,Shapely
需要将这几个库卸载后,使用whl重新安装。
- 卸载原有依赖库
pip uninstall Pillow
pip uninstall pyshp
pip uninstall Shapely
pip uninstall pyproj
- 在https://www.lfd.uci.edu/~gohlke/pythonlibs/#numba中查找并下载这几个库和你电脑的对应版本
此处下载的是:
Pillow-9.0.1-cp310-cp310-win_amd64.whl
pyproj-3.3.0-cp310-cp310-win_amd64.whl
pyshp-2.2.0-py3-none-any.whl
Shapely-1.8.1.post1-cp310-cp310-win_amd64.whl
3.安装库
pip install --user Shapely-1.8.1.post1-cp310-cp310-win_amd64.whl
pip install --user pyproj-3.3.0-cp310-cp310-win_amd64.whl
pip install --user pyshp-2.2.0-py3-none-any.whl
pip install --user Pillow-9.0.1-cp310-cp310-win_amd64.whl
pip install --user Cartopy-0.20.2-pp38-pypy38_pp73-win_amd64.whl
安装完成后,在pycharm中导入cartopy模块时不再报错,成功。
问题解决。
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhgfjfcj
-
在命令提示符下载pyecharts时出现“pip不是内部或外部命令”
-
linux pip报错WARNING: Running pip as the ‘root‘ user can result in broken permissions and conflicting
-
使用pip安装Cartopy库时,出现报错Getting requirements to build wheel did not run successfully.
-
pip intsall 安装报错 ERROR: Could not find a version that satisfies the requirementi
-
微信视频号直播1000个看过多少钱
-
python pip 卸载环境内所有的包
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
excel下划线不显示怎么办
PHP中文网 06-23 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
TikTok加速器哪个好免费的TK加速器推荐
TK小达人 10-01