Relative Content

Tag Archive for pythonfunctionpython-import

Python: How to import a function that depends on other modules

I’ve created a Python 3.11.5 project in Spyder 5.4.3 containing a main.py and functions.py file in the same directory. For the functions in my functions.py file, I use from sklearn.neighbors import KNeighborsClassifier and call KNeighborsClassifier in myFunc following this other question.