ImportError: cannot import name inplace_column_scale

前端 未结 7 1013
孤城傲影
孤城傲影 2020-12-11 00:32

Using Python 2.7 with scikit-learn 0.14 package. It runs well on some examples from the user guild expect the Linear Models.

Traceback (most recent call last         


        
相关标签:
7条回答
  • 2020-12-11 00:53

    I had the same problem. I had originally installed scikit-learn by:

    sudo apt-get install python-sklearn
    

    When none of the other solutions posted here worked, I decided to uninstall my version of scikit-learn and reinstall it:

    pip2 install --user --install-option="--prefix=" -U scikit-learn  
    

    Used pip2 because I have two versions of python, so I use scikit-learn in Python 2.7

    0 讨论(0)
  • 2020-12-11 00:54

    On a related note, this has been posted as a bug on the official Github page, along with some additional solutions, basically suggesting the same solutions as above. Long story short: run a make clean to get rid of the .so file.

    0 讨论(0)
  • 2020-12-11 00:55

    same problem happened with can not import _safe_split, have a look

    http://stackoverflow.com/questions/41024001/importerror-cannot-import-name-safe-split

    https://github.com/scikit-learn/scikit-learn/issues/7582

    EDIT: check comment by Andreas Mueller

    0 讨论(0)
  • 2020-12-11 01:01

    I solve this problem by :

    pip uninstall scikit-learn
    

    and don't forget to rm the 'sklearn' folder in the python 'site-packages'

    rm -rf /path/Python-2.7.5/lib/python2.7/site-packages/sklearn/
    

    then reinstall the package:

    pip install scikit-learn
    
    0 讨论(0)
  • 2020-12-11 01:06

    Uninstalling scikit-learn and reinstalling it was the only option that worked for me:

     pip uninstall scikit-learn
     pip install scikit-learn
    
    0 讨论(0)
  • 2020-12-11 01:15

    I encountered the same issue in Mac Os.

    I solved it by deleting the file manually:

    rm /usr/local/lib/python2.7/site-packages/sklearn/utils/sparsefuncs.so

    0 讨论(0)
提交回复
热议问题