I am converting to new style relative imports in Python 3.x. I am currently getting the error below when I try to perform an import from File1.py to utilsx.py
ValueError: Attempted relative import in non-package
I have the below folder structure. A project called MySuite contains all the tests in tests folder which is in the MySuite Project. These tests depend on certain utilities that exist in the utils project.
└── project
├── utils
│ ├── utils1.py
│ └── utils2.py
└── MySuite
├── Runner.py
└── Tests
└── File1.py
└── File2.py
└── File3.py
The import statement that I am attempting to use from File1 is:
from .utils.utils1 import *
I also tried:
from ..utils.utils1 import *
While I only expect one of them to work neither do! Any ideas to change syntax or maybe I forgot something?