I am developing a project which has a directory structure like this:
projectName package1 module1.py package2 module2.py
I am developing in Eclipse-PyDev and in module1.py i import module2 using this statement: import projectName.package2.module2
when i want to execute module1 I do:
cd projectName
python package1.module1
but it can not import module2 giving this error: ImportError: No module named projectName.package2
I'm new to Python and want to know the best practices for packaging and importing.
what i'm doing know is to put module2 in projectName directory and to remove projectName from all imports. This way i can execute the modules. But i have to change the file everytime i copy the development program into the deployment server.