我正试图在我的Anaconda安装中安装cartopy,但它无法工作。以下是错误消息。如何安装这个软件包?我试着用
pip install cartopy
和
conda install -c conda-forge cartopy
两人都犯了以下错误:
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给了我这些错误:
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: |
现在它只是坐在那里,有自旋。
我已经安装了地理包裹。我不知道为什么它找不到装置。
发布于 2022-09-28 06:49:03
这在Linux系统中为我解决了这个问题。我可以看到OP的系统是Windows,所以不确定它是否也适用于他们。但是对于在ubuntu/linux上登陆的人们来说,
我们需要首先安装libgeos-dev:
sudo apt install libgeos-dev
这是从https://techoverflow.net/2021/08/13/6348/那里得到的。
这似乎提供了提到的'geos_c.h‘文件。
在此之后,pip install cartopy
为我正常工作。
https://stackoverflow.com/questions/73466798
复制相似问题