I have been trying to fix this for a bit, and I must be missing something basic here (forgive me, I am relatively new to Python development):
I have a package structure like this:
base
|
-->util
__init__.py
Class1.py
Class2.py
__init__.py
Main.py
My classes are fairly benign:
class Class1(object):
def __init__(self):
# some methods...
class Class2(object):
def __init__(self):
# more methods...
In the Main.py, I have:
import utils
if __name__ == '__main__':
c1 = utils.Class1()
c2 = utils.Class2()
My PYTHONPATH is setup to include src, src\base, and src\base\utils. But, Python gives me this error when trying to run Main.py:
AttributeError: 'module' object has no attribute 'Class1'
Has someone encountered this, and do you know how to fix it? Thanks!