AnswerBun.com

Not able to install latest version of scikit-learn

Super User Asked on November 27, 2020

I am working on Debian Stable Linux with Python version 3.7.3 which is otherwise working very well. I have scikit-learn (sklearn) version 0.22.2 installed and I want to upgrade it to latest version 0.23

I am using following commands but they are not working:

$ python3 -m pip install --user scikit-learn 
Requirement already satisfied: scikit-learn in /home/abcd/.local/lib/python3.7/site-packages (0.22.2)
Requirement already satisfied: joblib>=0.11 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn) (0.14.1)
Requirement already satisfied: numpy>=1.11.0 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn) (1.18.1)
Requirement already satisfied: scipy>=0.17.0 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn) (1.4.1)


$ python3 -m pip install --user sklearn
Requirement already satisfied: sklearn in /home/abcd/.local/lib/python3.7/site-packages (0.0)
Requirement already satisfied: scikit-learn in /home/abcd/.local/lib/python3.7/site-packages (from sklearn) (0.22.2)
Requirement already satisfied: joblib>=0.11 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn->sklearn) (0.14.1)
Requirement already satisfied: scipy>=0.17.0 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.4.1)
Requirement already satisfied: numpy>=1.11.0 in /home/abcd/.local/lib/python3.7/site-packages (from scikit-learn->sklearn) (1.18.1)

Where is the problem and how can it be solved?

Note: pip is also upgraded to the latest version.

As pointed out in comments, output of pip show command:

$ python3 -m pip show scikit-learn
Name: scikit-learn
Version: 0.22.2
Summary: A set of python modules for machine learning and data mining
Home-page: http://scikit-learn.org
Author: None
Author-email: None
License: new BSD
Location: /home/abcd/.local/lib/python3.7/site-packages
Requires: joblib, scipy, numpy
Required-by: yellowbrick, tsfresh, sklearn, pingouin, MindsDB, lightwood

2 Answers

I am using following commands but they are not working:

$ python3 -m pip install --user scikit-learn
[...]
$ python3 -m pip install --user sklearn

When updating an existing, installed Python package with pip install, you should typically include the --upgrade (-U) option e.g.:

python3 -m pip install --upgrade --user scikit-learn

python3 -m pip install --upgrade --user sklearn

This option automates the process of uninstalling the prior version of the package and then collects and installs the most recent version available to pip.

Technically, you can also uninstall the package yourself with pip uninstall before using pip install, but using the --upgrade option saves a step.


Depending on your needs, it is also possible to use the --ignore-installed (-I) option (which simply ignores any installed packages and overwrites them). But this can break your system depending on the circumstances and shouldn't be used for general upgrades.


Correct answer by Anaksunaman on November 27, 2020

You can try installing it from Debian packages archive. Open terminal and run:

sudo apt-get update
sudo apt-get install python3-sklearn python3-sklearn-lib

Answered by Ruby on November 27, 2020

Add your own answers!

Related Questions

Convert mp3 to wav

1  Asked on August 31, 2020 by babu-james

     

Installing the numbers module in Python

1  Asked on August 27, 2020 by user402525

   

FFmpeg – set fade opacity

0  Asked on August 26, 2020 by oskar-ahlroth

 

How can I know on which drive is Windows installed?

6  Asked on August 24, 2020 by pietro

     

Why can’t remount the disk with command?

1  Asked on August 23, 2020 by showkey

     

Powershell || Cannot Change Cursor Shape

1  Asked on August 20, 2020 by zigg

   

Can’t exclude a directory pattern recursively

2  Asked on August 14, 2020 by steve-b

 

IPv6 IPv4-like DHCP Binding

0  Asked on August 8, 2020 by dork

         

Virus / malware stored inside database

1  Asked on August 7, 2020 by adam-przedniczek

       

I can’t install pip for python 3.5

1  Asked on August 6, 2020 by dev

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir