导入featuretools时出现ImportError:无法导入RelationshipPath
问题解决:ImportError: cannot import name 'RelationshipPath'
可能的原因及解决步骤
1. 导入语句错误
featuretools中,EntitySet是需要导入的类,而小写的entityset是对应的模块。如果你是想使用EntitySet类,正确的导入语句应该是:
from featuretools import EntitySet
误写为from featuretools import entityset会触发内部模块导入错误,进而出现你遇到的RelationshipPath找不到的问题。
2. 版本不兼容
若导入语句无误,大概率是featuretools版本不兼容导致的:
- 先检查当前安装的版本:
pip show featuretools - 若版本过旧,升级到最新稳定版:
pip install --upgrade featuretools - 若升级后仍报错,可能是最新版存在兼容性问题,可降级到近期稳定版本(比如1.23.0):
pip install featuretools==1.23.0
3. 重新安装库
如果以上方法都无效,尝试完全卸载后重新安装:
pip uninstall -y featuretools pip install featuretools
内容的提问来源于stack exchange,提问作者Franky
相关产品推荐
相关产品推荐

