最近使用pyCharm.初学sklearn,python3&anaconda环境都正常的情况下始终无法运行sklearn数据集。
经过一天反复尝试,其中包括重装python环境等均报错,最终查阅资料发现,问题出在python,anaconda自带环境里。
python解决方法:
python3 -m pip install --index https://pypi.mirrors.ustc.edu.cn/simple scikit-learn
anaconda解决方法:
用pip在anaconda Scripts目录中卸载numpy,scipy,matplotlib,scikit-learn相关。
pip uninstall scikit-learn
在anaconda Scripts目录中重装numpy,scipy,matplotlib,最后安装scikit-learn。
pip install -U --index https://pypi.mirrors.ustc.edu.cn/simple scikit-learn