I was using the cluster manager slurm and I was running a submission script with sbatch (with a python interpeter). The sbatch submission imported one of my modules called <
As Slurm copies the submission script to a specific location on the compute node to run it, your Python script will not find the modules that are in the submission directory.
But Slurm correctly sets the current working directory so you can explicitly add it to the python path with something like:
sys.path.append(os.getcwd())
near the beginning of your script.