安装dython后出现ImportError:无法从dython.nominal导入compute_associations
解决ImportError: cannot import name 'compute_associations' from 'dython.nominal'
- 问题根源:你安装的dython新版本中,
compute_associations函数已从dython.nominal模块移除或迁移,而tabsyndex依赖旧版dython的该函数位置。 - 解决方案1:安装兼容的dython旧版本
- 卸载当前dython:
pip uninstall -y dython - 安装指定兼容版本(以0.7.5为例,该版本保留
dython.nominal.compute_associations):pip install dython==0.7.5
- 卸载当前dython:
- 解决方案2:手动修改tabsyndex的导入路径(不推荐,需熟悉代码)
若不想降级dython,可找到tabsyndex的源码文件,将其中的from dython.nominal import compute_associations修改为:
新版本dython中该函数已迁移至from dython.data_utils import compute_associationsdata_utils模块。
内容的提问来源于stack exchange,提问作者leviathan99
相关产品推荐
相关产品推荐

