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

在Deepnote中导入great_expectations遇AttributeError错误求助

解决Great Expectations导入时的AttributeError问题

问题原因

你遇到的AttributeError: module 'clickhouse_sqlalchemy.types.common' has no attribute 'Int256'错误,是因为great_expectations的部分版本与最新版clickhouse-sqlalchemy存在依赖冲突——新版clickhouse-sqlalchemy移除了Int256在clickhouse_sqlalchemy.types.common下的定义,而great_expectations的代码仍在引用这个路径。

解决方案(针对基础演示环境)

因为你仅需要搭建基础演示环境,不需要ClickHouse相关功能,通过安装兼容版本的依赖即可解决:

步骤1:卸载现有冲突包

执行以下命令清理已安装的冲突版本:

!pip uninstall -y great_expectations clickhouse-sqlalchemy

步骤2:安装兼容版本组合

选择以下任一方案执行:

方案一:指定兼容的clickhouse-sqlalchemy版本后安装great_expectations

!pip install great_expectations clickhouse-sqlalchemy==0.1.8

方案二:安装旧版great_expectations(内置兼容的依赖版本)

!pip install great_expectations==0.17.15

步骤3:验证导入

执行以下代码确认问题解决:

import great_expectations as gx
print(f"Great Expectations版本: {gx.__version__}")

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.04 23:25:54