I'm running into a problem when I try to setup a virtual environment on Ubuntu, using "virtualenv --system-site-packages myenv", and trying to run my python script with slurm (srun/sbatch)
Although I have run my code without problem in the past, at this point i'm getting an "ModuleNotFoundError" when trying to run with my environment activated (source ./myenv/bin/activate)
I noticed that although I can run "python foo.py" normally with my current environment activated, "srun python foo.py" fails. In fact, by printint sys.version, I can see that the python version running with srun is different from the python command withour srun, which tells me that the environment is changed (and thus cannot find my packages). "srun python --version" also confirms this.
Has anyone had a similar problem?
Thanks