How to import a directory to a file in the same directory ?? i have tried it this way but line 7 throws an error Module Not found.
Asked
Active
Viewed 28 times
-1
-
2FYI `core.py` is not in the same directory as the directory `classification_model`. – mkrieger1 Apr 11 '23 at 19:25
-
Importing from your own package is hard. I recommend reading this: https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time – RedKnite Apr 16 '23 at 04:43
1 Answers
0
your classification_model
does not have an init file, try importing the specific file you want, like: import classification_model.pipeline as pipeline
or something similar, alternatively you can add an __init__.py
and add imports to whatever you want to expose, however maybe you should rethink your files hierarchy

ACoolName
- 1
- 1