I tried to import DataPreprocessor class in dgnfiai/gdnfiai/preprocessing/preprocessing.py my self-developed package gdnfiai into colab notebook but got ImportError: cannot import name 'preprocessing' from 'gdnfiai' (unknown location). The package can be successfully imported on my laptop. I think maybe the problem is colab's default directory so I changed the directory on colab using
import sys
sys.path.append('/content/gdnfiai/')
but still got the same error.
The structure of the package and my code for import is shown in the screenshot here:
The exact steps I did are:
sys.path.append('/content/gdnfiai/')
pip install -e .
from gdnfiai.preprocessing.preprocessing import DataPreprocessor
and got ModuleNotFoundError.It might be due to your typo in the preprocessing
directory, with the filename __inti__.py
. Rename it to __init__.py
, as in your other directories.