Python安装imblearn库

为了处理非均衡数据集,为了使用SMOTE。

错误1:

ERROR: Could not find a version that satisfies the requirement imblearn
ERROR: No matching distribution found for imblearn

解决办法:

出现该错误信息是因为pip源连接证书验证失败,将pip源调整为国内的源就可以了,比如要下载psutil
pip install imblearn -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

错误2:

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied

解决办法:

pip install --user imblearn -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

加user的原因:

pip默认将Python包安装到系统目录(例如/usr/local/lib/python3.4).这需要root访问权限.
–user会在您的主目录中生成pip安装包,而不需要任何特殊权限.

猜你喜欢

转载自blog.csdn.net/weixin_61823031/article/details/126474886