ImportError: cannot import name inplace_column_scale

前端 未结 7 1014
孤城傲影
孤城傲影 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 01:17

    I was able to fix this by going to my python folder and deleting the file:

    python27\Lib\site-packages\sklearn\utils\sparsefuncs.pyd
    

    My guess is that the problem was:

    1. An older version of scikit-learn implemented sparsefuncs as a windows DLL
    2. The current version implements it as a python file
    3. If you install a new version on top of an old version it does not delete the old DLL
    4. When you try to import, Python uses the pyd in preference to the py implementation
    5. But the old implementation did not include this function

    This suggests that there might be bigger problems caused by installing a new version and it might be wise to delete the whole sklearn directory before reinstalling the new version.

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