Matplotlib errors while running MRIQC

Summary of what happened:

Hello Neurostars Experts!

I am running MRIQC using ‘datalad containers-run’ (with Singularity containers) with command

It works normally until I added restrictive options --n_cpus 24 --mem_gb 128. After that, I got the error massages like this:

We tried to set environment variable for the default path (/home/mriqc/.config/matplotlib) with write permission but it did not help, even though we ran the command without extra options…

There is a similar situation here but in my case the matplotlib stopped generating figures so the outputs were not intact.

Does anyone know how to configure it to define a cache dir correctly? Thank you for any help you could offer!

Command used (and if a helper script was used, a link to the helper script or the command generated):

datalad containers-run -m "run mriqc on sub-XXX" -i "BIDS/sub-KULXXX/*" 
-o "mriqc/sub-XXX/*" -n pipeline/mriqc BIDS mriqc participant 
--participant-label XXX --verbose --verbose-reports --fd_thres 0.9


Environment (Docker, Singularity / Apptainer, custom installation):

Singularity (via datalad run)

Data formatted according to a validatable standard? Please provide the output of the validator:


Relevant log outputs (up to 20 lines):

Matplotlib created a temporary config/cache directory at /tmp/matplotlib-3yjspzlp 
because the default path (/home/mriqc/.config/matplotlib) is not a writable directory; 
it is highly recommended to set the MPLCONFIGDIR environment variable to a writable 
directory, in particular to speed up the import of Matplotlib and to better support 
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories

Screenshots / relevant information: