You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装geemap时遭遇metadata生成失败错误,寻求解决办法

geemap安装失败问题排查与解决建议

我是Python新手,正在为项目使用geemap。执行pip install geemap命令时,持续出现如下错误:

Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      + meson setup C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f\.mesonpy-tl69drhd -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f\.mesonpy-tl69drhd\meson-python-native-file.ini
      The Meson build system
      Version: 1.5.0
      Source dir: C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f
      Build dir: C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f\.mesonpy-tl69drhd
      Build type: native build
      Program python3 found: YES (C:\Users\sam\.pyenv\pyenv-win\shims\python3.BAT)

      ..\meson.build:4:11: ERROR: Command `C:\Users\sam\.pyenv\pyenv-win\shims\python3.BAT -m setuptools_scm` failed with status 1.

      A full log can be found at C:\Users\sam\AppData\Local\Temp\pip-install-fms64_bl\matplotlib_05359f411a1a48a6870271952064ee1f\.mesonpy-tl69drhd\meson-logs\meson-log.txt
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

我已尝试以下操作但未解决:

  • 在虚拟环境中安装
  • 执行pip install --upgrade pip setuptools wheel
  • 执行pip cache purge
  • 执行pip install --upgrade --force-reinstall setuptools
  • 手动安装numpy、pandas、ipywidgets、earthengine-api、folium依赖包
  • 尝试安装指定版本的依赖

针对性解决建议

  • 检查并修复setuptools_scm:先单独安装pip install setuptools_scm,然后执行python -m setuptools_scm验证是否能正常运行。如果报错,排查环境变量或pyenv的Python映射问题。
  • 修复pyenv的python3映射:直接运行C:\Users\sam\.pyenv\pyenv-win\shims\python3.BAT -m setuptools_scm查看具体错误,确保pyenv的python3指向正确的Python版本,必要时重新配置pyenv。
  • 强制使用matplotlib预编译包:执行pip install matplotlib --only-binary :all:,避免源码编译触发Meson错误,完成后再执行pip install geemap。
  • 尝试conda安装:若有conda环境,执行conda install -c conda-forge geemap,conda会自动处理所有依赖的预编译版本,规避pip的编译问题。
  • 降级或重装Meson:执行pip uninstall meson -y && pip install meson==1.4.0,新版本Meson可能存在兼容性问题,降级后再尝试安装。

内容的提问来源于stack exchange,提问作者Sam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.20 18:13:18