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

Linux下pip安装pandas-profiling报markupsafe版本不匹配错误如何解决

报错原因

当前你要安装的pandas-profiling版本依赖约束为markupsafe~=2.0.1,即要求markupsafe版本处于>=2.0.1且<2.1.0区间,而你本地已安装的markupsafe版本为1.1.1,且你当前pip可检索到的markupsafe版本最高仅到1.1.1,无法满足依赖要求,因此触发报错:

ERROR: Could not find a version that satisfies the requirement markupsafe~=2.0.1 (from pandas-profiling) (from version 0.9,...,1.1.1).

解决步骤
  • 先升级基础包管理工具到最新版本,避免旧版本工具无法识别新包版本
    执行命令:
    pip install --upgrade pip setuptools wheel
  • 卸载本地已有的低版本markupsafe
    执行命令:
    pip uninstall -y markupsafe
  • 手动安装符合依赖要求的markupsafe版本
    执行命令:
    pip install markupsafe==2.0.1
  • 重新安装pandas-profiling
    执行命令:
    pip install pandas-profiling
  • 若上述步骤仍提示找不到对应版本的markupsafe,大概率是你使用的第三方pip源未同步该版本包,可临时切换官方pypi源安装:
    执行命令:
    pip install markupsafe==2.0.1 pandas-profiling -i https://pypi.org/simple
  • 如果你使用的Python版本为3.6及更早版本,markupsafe 2.0+已停止支持该版本Python,可直接安装适配低版本Python的pandas-profiling:
    执行命令:
    pip install pandas-profiling==3.1.0

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.09.28 16:06:04