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