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!

3
  • 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. Commented Jan 2, 2017 at 17:52
  • I'm using numpy-1.12.0rc2+mkl Commented Jan 2, 2017 at 18:24
  • i got it to work! here's this post:stackoverflow.com/questions/40693558/… Commented Jan 2, 2017 at 18:30

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.