第一步:更新pip
可以首先执行 python -m ensurepip 然后执行 python -m pip install --upgrade pip 即可更新完毕。
第二步 安装sklearn的时候一定要注意顺序。
安装顺序:numpy / scipy / matplotlib / scikit-learn
numpy安装命令(仅numpy这样能安装成功,其他的安装使用另外一个命令):pip install numpy
只有numpy 安装成功了,而且还很慢,后续安装其他包的时候,如果使用pip install scipy ,会出现满屏红色,统统失败!
解决办法使用:
输入命令应该为:pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ numpy
第三步 以此类推matplotlib / scikit-learn
输入命令应该为:pip install --index https://pypi.mirrors.ustc.edu.cn/simple/ 包名
详情进入