Can't seem to update to sklearn 0.19 with pip?

Viewed 5906

First I tried to update the package according to the documentation using the commands below:

pip install -U scikit-learn

or

conda install scikit-learn

But the version is still 0.18 in PyCharm. Then I tried to run the update in "Settings--Project Interpreter", but failed with this error:

InstallError: Error: one or more of the packages already installed depend on 'conda' and should only be installed in the root environment: conda conda-env. These packages need to be removed before conda can proceed.

I'm totally stuck now. Appreciate any help in advance!

2 Answers

You can use use virtualenv in pip and install scikit-learn inside the venv. With that solution you dont have to remove sci-kit from conda.

Install virtualenv using pip3

sudo pip3 install virtualenv 

** Create a virtual environment**

virtualenv venv 

Active your virtual environment:

source venv/bin/activate

Then you can install now anything you want.

pip install -U scikit-learn

I was facing the same issue and was not able to update sklearn. I first removed the scikit-learn package by the below command and then installed scikit-learn in update mode and it got updated successfully.

conda remove scikit-learn
Related