在 python 中安装 Imblearn 期间找不到版本错误

Could not find version error during install Imblearn in python

我正在尝试安装 Imblearn 以在 python 中执行 SMOTE。我一直在尝试安装 imblearn 包。但是我经常出错。以下是我试过的命令,

pip install imblearn

pip install git+https://github.com/fmfn/UnbalancedDataset

下面是我遇到的错误,

Collecting imblearn
  Using cached https://files.pythonhosted.org/packages/81/a7/4179e6ebfd654bd0eac0b9c06125b8b4c96a9d0a8ff9e9507eb2a26d2d7e/imblearn-0.0-py2.py3-none-any.whl
Collecting imbalanced-learn (from imblearn)
  Using cached https://files.pythonhosted.org/packages/e0/87/39a4cecebc7fb9ddb433fe8bc7f76379b4918a0ade91f8a1423dc25c7ddc/imbalanced-learn-0.5.0.tar.gz
Requirement already satisfied: numpy>=1.11 in 
Requirement already satisfied: scipy>=0.17 in 
Collecting scikit-learn>=0.21 (from imbalanced-learn->imblearn)
  ERROR: Could not find a version that satisfies the requirement scikit-learn>=0.21 (from imbalanced-learn->imblearn) (from versions: 0.9, 0.10, 0.11, 0.12, 0.12.1, 0.13, 0.13.1, 0.14, 0.14.1, 0.15.0b1, 0.15.0b2, 0.15.0, 0.15.1, 0.15.2, 0.16b1, 0.16.0, 0.16.1, 0.17b1, 0.17, 0.17.1, 0.18rc2, 0.18, 0.18.1, 0.18.2, 0.19b2, 0.19.0, 0.19.1, 0.19.2, 0.20rc1, 0.20.0, 0.20.1, 0.20.2, 0.20.3, 0.21rc2)
ERROR: No matching distribution found for scikit-learn>=0.21 (from imbalanced-learn->imblearn)

因此我无法继续我的建模部分,因为我的数据严重不平衡。有人可以帮我安装这个包吗?如果没有,在 python 中执行 SMOTE 的替代方法是什么?

pip 安装命令已更改。如下

https://pypi.org/project/scikit-learn/0.21.0/

Scikit-learn 0.20 是最后一个支持 Python2.7 的版本。 Scikit-learn 0.21 及更高版本需要 Python 3.5 或更新版本。

参考以下内容link:

https://pypi.org/project/scikit-learn/0.21.0/

我建议使用 Python3