I am following the easy guide on the Python Central to create a package for my code:
https://www.pythoncentral.io/how-to-create-a-python-package/
So my directory structure is:
main.py
pack1/
__init__.py
Class1.py
In the main.py
file I import and use Class1
as:
from pack1 import Class1
var1 = Class1()
In the __init__.py
file I have written:
import Class1 from Class1
I followed the guide exactly and still get the error:
ModuleNotFoundError: No module named 'Class1' (in __init__.py)