I am running into a very frustrating syntax error that is appearing in the following scenario:
package
__init__.py
module1.py
module2.py
The __init__.py
contains the following import:
from . import module1
module1.py
contains the following import:
from . import module2
I get a syntax error right when it hits the explicit relative import in module1.py
, so it would seem that the import in __init__.py
is working correctly.
Earlier, I had things setup where I was importing module1.py
like this:
from package import module1
Which worked correctly, so I am very confused as to why I am getting this error...
Any help would be much appreciated! Thanks!