Sklearn导入错误

时间:2017-01-02 17:50:21

标签: python-3.x

我尝试从sklearn导入预处理,模型选择和svm,但我收到此错误:

  

追踪(最近一次通话):         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ ProjectFiles \ Machine_Learing.py",   第4行,在           来自sklearn import preprocessing,model_selection,svm         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ sklearn__init __。py",   57号线,在           来自.base导入克隆         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ sklearn \ base.py",   第12行,在           来自.utils.fixes导入签名         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ sklearn \ utils__init __。py",   第11行,在           来自.validation import(as_float_array,         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ sklearn \ utils \ validation.py",   第18行,在           来自..utils.fixes导入签名         文件" C:\ Users \ SmallYellowFace \ AppData \ Local \ Programs \ Python \ Python35 \ lib \ site-packages \ sklearn \ utils \ fixes.py",   406号线           如果np_version< (1,12,0):       TypeError:unorderable类型:str()< INT()

我累了重新安装python和模块

谢谢!

1 个答案:

答案 0 :(得分:0)

>> pip install --upgrade numpy

OR

>> sudo pip3 install --upgrade numpy

SKlearn有几个依赖,numpy是主要的依赖。即使安装了numpy,您的SKlearn版本也可能已过时