使用PowerTransformer时遇AttributeError: module 'numpy' has no attribute 'warnings'错误求助
解决AttributeError: module 'numpy' has no attribute 'warnings'问题
这个错误源于numpy版本不兼容或安装损坏,以下是具体解决步骤:
先检查当前numpy版本:
import numpy print(numpy.__version__)若版本低于1.20.x,基本是版本过低引发的兼容性问题。
升级numpy到兼容版本:
使用pip执行:pip install --upgrade numpy用conda环境则执行:
conda update numpy若升级后问题仍存在,大概率是numpy安装损坏,重新安装:
pip方式:pip uninstall numpy -y pip install numpyconda方式:
conda remove numpy -y conda install numpy额外建议:同步升级scikit-learn到最新兼容版本,规避其他潜在兼容性问题:
pip install --upgrade scikit-learn
内容的提问来源于stack exchange,提问作者Akash Kumar
相关产品推荐
相关产品推荐

