wish helps you An .egg is just a .zip file that acts like a directory from which you can import stuff. You can use the PYTHONPATH variable to add the .egg to your path, or append a directory to sys.path. Another option is to use a .pth file pointing to the eggs.
this will help If you are running from Project folder, set a variable(PRJ_PATH) to os.getcwd() and use it for opening the file like open(os.path.join(PRJ_PATH, 'data', 'data.txt')) If you are running from subdirectories, set a variable(PRJ_PATH) to os.path.join(os.getcwd(), '..') and then use it for opening the file like open(os.path.join(PRJ_PATH, 'data', 'data.txt'))
Python: importing module from subdirectory that loads non-python file with relative path