Python imports relative path
I've got a project where I would like to use some python classes located in other directories. Example structure: /dir +../subdirA +../subdirB +../mydir The absolute path varies, because this project is run on different machines. When my python file with MySampleClass located in /mydir is executed, how do I import OtherClassRoot located in /dir or OtherClassA located in /subdirA ? I tried things like: from . import MySampleClass as msc or from ../ import MySampleClass as msc but this always fails or gives me error messages like Attempted relative import in non-package So, whats the right way