A while ago I used to run Python+Neuron scripts and models in a computing cluster without the need of GUI. But now I can't; I don't know what may have changed.
I have this simple code:
Code: Select all
import matplotlib
matplotlib.use('Agg')
from neuron import h
print("h imported")
h.load_file("stdrun.hoc")
print("stdrun loaded")
soma = h.Section()
print("soma created")
But then if I go to one of the computing nodes, that lack graphical capabilities, I get
Code: Select all
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
h imported
stdrun loaded
soma created
The problem is when I submit the code as a slurm job. In that case, the output is
Code: Select all
MoTTY X11 proxy: No authorisation provided
can't open DISPLAY
How can I import neuron.h without a display environment? And why the "--No graphics will be displayed" warning message changes to "can't open DISPLAY" error when submitting the same code via slurm?
Thanks!