1

I'm trying to import preprocessing, model selection and svm from sklearn, but I'm getting this error:

Traceback (most recent call last): File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\ProjectFiles\Machine_Learing.py", line 4, in from sklearn import preprocessing, model_selection, svm File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn__init__.py", line 57, in from .base import clone File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\base.py", line 12, in from .utils.fixes import signature File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils__init__.py", line 11, in from .validation import (as_float_array, File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\validation.py", line 18, in from ..utils.fixes import signature File "C:\Users\SmallYellowFace\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\utils\fixes.py", line 406, in if np_version < (1, 12, 0): TypeError: unorderable types: str() < int()

I tired reinstall python and modules

Thanks!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Jcheong
  • 21
  • 6
  • `np_version` is a string and you're trying to compare it to a tuple of integers. please give more information about the format of `np_version`. – FlipTack Jan 02 '17 at 17:52
  • I'm using numpy-1.12.0rc2+mkl – Jcheong Jan 02 '17 at 18:24
  • i got it to work! here's this post:http://stackoverflow.com/questions/40693558/typeerror-unorderable-types-str-int?answertab=active#tab-top – Jcheong Jan 02 '17 at 18:30

1 Answers1

0
>> pip install --upgrade numpy

OR

>> sudo pip3 install --upgrade numpy

SKlearn has a couple dependencies, numpy being the main one. Even if numpy is installed then it may be out-dated for your version of SKlearn

Owen Easter
  • 248
  • 2
  • 10