I am facing weird problem, although new to python. And this looks bit different from already stated on several forums.
Directory structure:
Project_Folder
-- Folder A
-- SubFolder A1
-- Subfolder A2
-- Subfolder A3
-- Folder A3-1
-- XYZ.py
-- Subfolder A4 ( this contains utility classes)
-- A4-1.py
-- A4-2.py
NOTE: All folders contain __init__.py, also PYTHON PATH contains all required directories in PATH.
Script XYZ.py ... is dependent on below 2 utilities classes. Scipts starts with appending on sys.path the sub-folder A4 so ideally there is not need to use A4.A4-1.py instead directly A4-1 should work on import. Like below from A4-1.py import sub-methods from A4-2.py import sub-methods
But this is giving an issue ... as stated in subject. However, same works if I use A4.A4-1.py
Weird part, is same script work on server where project was already setup.
Being new to Python, I need to understand how I am able to execute this script from local machine. (without changing or using Module name in import)
Also, I am using IDE INtelliJ where I have added A4 as dependency to my project. And compiler is able to resolve it but execution is throwing import error ...
Any help is appreciated.
__init__.pyso that you don't get a bold, and people won't suspect that is the error..pyin your import statement.