Given a github project with the following structure:
mylib/
package1/
package2/
...
packagen/
scripts/
x/a.py
x/b.py
.....
.....
x/z.py
In the scripts directory there many scripts in many subfolders. In these scripts the packages of mylib are used.
The problem is that somehow we have to tell python where the lib directories are. Otherwise i cannot import the modules.
The solutions in the web i found are not satisfying
Solution 1: Use the sys library:
import sys
sys.path.insert(0,"..\..")
from mylib.package1 import classX
This is not good because i have to write it in every script and if i change the directory structure everything has to be modified
Solution2: Change the PYTHONPATH
This is also not good because i want to collaborate with my friends and i don't want to tell them to change the python path
Is there a better solution?