首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >试图安装cartopy python Anaconda时出错

试图安装cartopy python Anaconda时出错
EN

Stack Overflow用户
提问于 2022-08-24 02:23:29
回答 1查看 170关注 0票数 1

我正试图在我的Anaconda安装中安装cartopy,但它无法工作。以下是错误消息。如何安装这个软件包?我试着用

代码语言:javascript
运行
复制
pip install cartopy 

代码语言:javascript
运行
复制
conda install -c conda-forge cartopy  

两人都犯了以下错误:

代码语言:javascript
运行
复制
Building wheels for collected packages: cartopy
  Building wheel for cartopy (PEP 517): started
  Building wheel for cartopy (PEP 517): finished with status 'error'
Failed to build cartopy

ERROR: Command errored out with exit status 1:
  command: 'C:\Users\ruben\anaconda3\python.exe' 'C:\Users\ruben\anaconda3\lib\site- 
  packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C

<string>:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or 
later installed, or installation may fail.

Fobuild\temp.win-amd64-cpython-39\Release\lib/cartopy/trace.obj
 trace.cpp
lib/cartopy/trace.cpp(719): fatal error C1083: Cannot open include file: 'geos_c.h': No 
such file or directory
error: command 'C:\\Program Files\\Microsoft Visual 
Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX86\\x64\\cl.exe' failed 
with exit code 2
----------------------------------------
ERROR: Failed building wheel for cartopy
ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed 
directly

Anaconda给了我这些错误:

代码语言:javascript
运行
复制
conda install cartopy

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |

现在它只是坐在那里,有自旋。

我已经安装了地理包裹。我不知道为什么它找不到装置。

EN

回答 1

Stack Overflow用户

发布于 2022-09-28 06:49:03

这在Linux系统中为我解决了这个问题。我可以看到OP的系统是Windows,所以不确定它是否也适用于他们。但是对于在ubuntu/linux上登陆的人们来说,

我们需要首先安装libgeos-dev:

代码语言:javascript
运行
复制
sudo apt install libgeos-dev

这是从https://techoverflow.net/2021/08/13/6348/那里得到的。

这似乎提供了提到的'geos_c.h‘文件。

在此之后,pip install cartopy为我正常工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73466798

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档