ImportError: No module named model_selection

后端 未结 11 599
攒了一身酷
攒了一身酷 2021-01-30 08:16

I am trying to use train_test_split function and write:

from sklearn.model_selection import train_test_split

and this causes

11条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 08:32

    To install scikit-learn version 18.0, I used both commands:

    conda update scikit-learn

    pip install -U scikit-learn

    But it does not work. There was a problem "Cannot install 'scikit-learn'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall".

    Finally, i can install it by using following command:

    pip install --user --upgrade scikit-learn==0.18.0

提交回复
热议问题