无法将scikit-learn更新到版本0.20

时间:2018-11-15 08:59:18

标签: python scikit-learn anaconda conda

我正在尝试通过运行将sklearn从0.19.2更新到0.20

conda update scikit-learn
在anaconda提示符下输入

,但它不会更新软件包... 我得到

Solving environment: done

# All requested packages already installed.

我也尝试过

conda update conda

,然后再次conda update scikit-learn,但我也得到了(两个更新)

Solving environment: done

# All requested packages already installed.

如果我仍然检查sklearn版本,

import sklearn
sklearn.__version__

 '0.19.2'

如果我输入conda info,我会得到

     active environment : base
    active env location : C:\ProgramData\Anaconda3
            shell level : 1
       user config file : C:\Users\xxx\.condarc
 populated config files :
          conda version : 4.5.11
    conda-build version : 3.10.5
         python version : 3.6.5.final.0
       base environment : C:\ProgramData\Anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/win-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\xxx\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs
                          C:\Users\xxx\AppData\Local\conda\conda\envs
                          C:\Users\xxx\.conda\envs
               platform : win-64
             user-agent : conda/4.5.11 requests/2.18.4 CPython/3.6.5 Windows/10 Windows/10.0.17134
          administrator : True
             netrc file : None
           offline mode : False

如果我尝试安装sklearn 0.20.0

conda install scikit-learn=0.20.0
Solving environment: done

## Package Plan ##

  environment location: C:\ProgramData\Anaconda3

  added / updated specs:
    - scikit-learn=0.20.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    scikit-learn-0.20.0        |   py36heebcf9a_1         5.2 MB

The following packages will be REMOVED:

    imbalanced-learn: 0.3.3-py_0            conda-forge

The following packages will be UPDATED:

    scikit-learn:     0.19.2-py36heebcf9a_0             --> 0.20.0-py36heebcf9a_1

Proceed ([y]/n)? n

我知道sklearn正在尝试删除我使用的软件包(学习不平衡)。

我应该卸载并重新安装吗?

2 个答案:

答案 0 :(得分:1)

学习不平衡似乎需要特定版本的 scikit-learn 。如果要将sklearn升级到最新版本,则可能必须删除不平衡学习

建议:

我建议与python-virtualenv合作,这样可以为python项目创建单独的环境并处理程序包依赖性,而不会影响主系统。

答案 1 :(得分:0)

scikit-learn需要numpyscipy
因此,在升级scikit-learn之前,请确保同时安装了numpyscipy的兼容版本,然后尝试升级scikit-learn