First of all, I am really a python idiot, and this is my first python test.
I am running a test_predictors.ipynb
file using Jupyter. I ran into an "ImportError: No module named" error when executing the test_predictors.ipynb
file by block, like following:
The decisioni_tree.py
is another .py file in the same folder as test_predictors.ipynb
. calculate_information_gain, decision_tree_train, decision_tree_predict
are all functions defined in decisioni_tree.py
. The following picture is showing the file layout:
I searched a lot of threads, tried putting all .py files into a subfolder, or adding a leading dot in front of decisioni_tree
, or adding full path to decisioni_tree
, but none of these worked.
I also read PEP, but it does not make much sense to me. Now I am really clueless. I guess it was the path problem, but I don't figure out the logic behind how python arrange their path. I am wondering anyone can give some pointers? How should I solve this problem? Thanks.
I am using Windows 10, with I think Python 3.4/3.5 installed.