`from ..pyimagesearch.datasets.simpledatasetloader import SimpleDatasetLoader ImportError: attempted relative import with no known parent package` I am getting errors as above while importing the module. I am not using VM and I am on the python 3.9.12 version. import code : from ..pyimagesearch.datasets.simpledatasetloader import SimpleDatasetLoader from ..pyimagesearch.preprocessing.simplepreprocessor import SimplePreprocessor Dir structure . ├── changeDir.bat ├── Chapter07 │ └── knn.py ├── pyimagesearch │ ├── callbacks │ │ ├── __init__.py │ │ └── trainingmonitor.py │ ├── datasets │ │ ├── __init__.py │ │ └── simpledatasetloader.py │ ├── __init__.py │ ├── nn │ │ ├── conv │ │ │ ├── __init__.py │ │ │ ├── lenet.py │ │ │ ├── minivggnet.py │ │ │ └── shallownet.py │ │ ├── __init__.py │ │ ├── neuralnetwork.py │ │ └── perceptron.py │ ├── preprocessing │ │ ├── imagetoarraypreprocessor.py │ │ ├── __init__.py │ │ └── simplepreprocessor.py │ └── utils │ ├── captchahelper.py │ └── __init__.py └── Starter-Bundle.ipynb
Activity
vikaskookna commentedon Jun 10, 2022
Hi @isahillohiya can you please use the absolute path rather than a relative path
Add your directory to the path by using this code on top of py file