How to upgrade scikit-learn package in anaconda

前端 未结 6 976
难免孤独
难免孤独 2020-12-01 05:33

I am trying to upgrade package of scikit-learn from 0.16 to 0.17. For that I am trying to use binaries from this website: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-l

相关标签:
6条回答
  • 2020-12-01 06:00

    I would suggest using conda. Conda is an anconda specific package manager. If you want to know more about conda, read the conda docs.

    Using conda in the command line, the command below would install scipy 0.17.

    conda install scipy=0.17.0
    
    0 讨论(0)
  • 2020-12-01 06:00

    If you are using Jupyter in anaconda, after conda update scikit-learn in terminal, close anaconda and restart, otherwise the error will occur again.

    0 讨论(0)
  • 2020-12-01 06:03

    Anaconda comes with the conda package manager which is designed to handle these kinds of upgrades. Start by updating conda itself to get the most recent package lists:

    conda update conda
    

    And then install the version of scikit-learn you want

    conda install scikit-learn=0.17
    

    All necessary dependencies will be upgraded as well. If you have trouble with conda on Windows, there are some relevant FAQ here: http://docs.continuum.io/anaconda/faq

    0 讨论(0)
  • So to upgrade scikit-learn package, you have to follow below process

    Step-1: Open your terminal(Ctrl+Alt+t)

    Step-2: Now for checking currently installed packages along with the versions installed on your conda environment by typing conda list

    Step-3: Now for upgrade type below command

    conda update scikit-learn
    

    Hope it helps!!

    0 讨论(0)
  • 2020-12-01 06:14

    Following Worked for me for scikit-learn on Anaconda-Jupyter Notebook.

    Upgrading my scikit-learn from 0.19.1 to 0.19.2 in anaconda installed on Ubuntu on Google VM instance:

    Run the following commands in the terminal:

    First, check existing available packages with versions by using:

    conda list    
    

    It will show different packages and their installed versions in the output. Here check for scikit-learn. e.g. for me, the output was:

    scikit-learn              0.19.1           py36hedc7406_0  
    

    Now I want to Upgrade to 0.19.2 July 2018 release i.e. latest available version.

    conda config --append channels conda-forge
    conda install scikit-learn=0.19.2
    

    As you are trying to upgrade to 0.17 version try the following command:

    conda install scikit-learn=0.17
    

    Now check the required version of the scikit-learn is installed correctly or not by using:

    conda list 
    

    For me the Output was:

    scikit-learn              0.19.2          py36_blas_openblasha84fab4_201  [blas_openblas]  conda-forge
    

    Note: Don't use pip command if you are using Anaconda or Miniconda

    I tried following commands:

    !conda update conda 
    !pip install -U scikit-learn
    

    It will install the required packages also will show in the conda list but if you try to import that package it will not work.

    On the website http://scikit-learn.org/stable/install.html it is mentioned as: Warning To upgrade or uninstall scikit-learn installed with Anaconda or conda you should not use the pip.

    0 讨论(0)
  • 2020-12-01 06:14

    Updating a Specific Library - scikit-learn:

    Anaconda (conda):

    conda install scikit-learn
    

    Pip Installs Packages (pip):

    pip install --upgrade scikit-learn
    

    Verify Update:

    conda list scikit-learn
    

    It should now display the current (and desired) version of the scikit-learn library.

    For me personally, I tried using the conda command to update the scikit-learn library and it acted as if it were installing the latest version to then later discover (with an execution of the conda list scikit-learn command) that it was the same version as previously and never updated (or recognized the update?). When I used the pip command, it worked like a charm and correctly updated the scikit-learn library to the latest version!

    Hope this helps!

    More in-depth details of latest version can be found here (be mindful this applies to the scikit-learn library version of 0.22):

    • Release Highlights for scikit-learn 0.22
    0 讨论(0)
提交回复
热议问题