为 python3 更新 sklearn 而不是最新版本

Updating sklearn for python3 not the latest version

我希望在 Ubuntu 中更新我的 sklearn 版本,我被告知它是最新的,但我知道有更新的版本。

我正在从命令行输入

sudo apt-get install python3-sklearn-lib

然后我收到一条消息说

Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-sklearn-lib is already the newest version (0.17.0-4).
python3-sklearn-lib set to manually installed.
The following packages were automatically installed and are no longer required:
  libpython-all-dev libpython-dev libpython2.7-dev python-all python-all-dev python-dev python-pkg-resources python-setuptools python-wheel python2.7-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

不过我知道 sklearn 网站上的最新版本是 0.21.1

为什么我被告知版本是最新的,而明明不是?

为了 apt-get 安装任何库的最新版本,apt-get 也必须更新。为此 运行

apt-get update

这将更新 apt-get 中的依赖项,然后 运行 您的命令。

最后,我以 root 身份登录,然后使用以下内容明确指定版本

conda install scikit-learn=0.20.3