My situation:
I cloned a git repo on my local machine and could instantly run all the scripts.
Then I cloned the same repo on a SLURM cluster and the script fails with modulenotfound error. After looking left and right, printing the pwd and what not, I decided to create an __init__.py
in the subdirectory where the load failed. BAM now it fails for another import. So I assume I have to follow the fails and put __init__.py
everywhere.
But why is it working on my local machine?
When do I need __init__.py
and when not?
And could it be resolved by some clever python path assignments?