Import KNN error TabError occurred in pycharm

import KNN
from numpy import *

def createDataSet():
    group = [[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]]
    labels = ["A","A","B","B"]
    return group,labels
group,labels = KNN.createDataSet()
print (createDataSet())

error running Times

C:\Users\17578\venv\Scripts\python.exe C:/Users/17578/.PyCharm2018.3/config/.py
Traceback (most recent call last):
  File "C:/Users/17578/.PyCharm2018.3/config/.py", line 2, in <module>
    import KNN
  File "C:\Users\17578\venv\lib\site-packages\KNN.py", line 24
    print(sortedDistIndicies[i])
                               ^

TabError: inconsistent use of tabs and spaces in indentation

conventional solutions to TabError have been tried. "import KNN" may still be a problem in this place.

Jun.01,2022

Brother, it's not your fault. I just installed this KNN. The author of this third-party library is speechless. He seems to be deliberately teasing you. You have to learn to question the authors of these third-party libraries. You see:
clipboard.png
, , python, 60, 67!

:

clipboard.png

, :

clipboard.png

that's right, this guy took Python2 to write, hehehe, and then you change all the print written in Python2 style to print ()
in python3 style. All right, I can only help you here
should be these small problems, if there are any questions, send me the KNN.py file under your python third-party library folder, and I'll show you!


literally, indentation mixes tabs and spaces, which is prohibited.
similar questions, not familiar with English, can be directly glued to the search engine can also roughly understand the meaning.
it is recommended to familiarize yourself with the basics of python.
for example, common exception types of py3:
python.org/3/library/exceptions.html-sharpbltin-exceptions" rel=" nofollow noreferrer "> https://docs.python.org/3/lib...

there are other differences in syntax between python2 and python3, so you need to pay attention to the version of the code.

Menu