matplotlib error when running basic review

AFNI version info (afni -ver):
Precompiled binary linux_centos_7_64: May 27 2024 (Version AFNI_24.1.15 'Publius Septimius Geta')

apqc_make_tcsh.py -review_style basic -subj_dir . -uvar_json out.ss_review_uvars.json

Hello,

When running afni_proc.py, the QC html generation fails with the following output:

Traceback (most recent call last):
File "/opt/afni/24.1.15/apqc_make_tcsh.py", line 261, in
from afnipy import lib_apqc_tcsh as lat
File "/opt/afni/24.1.15/afnipy/lib_apqc_tcsh.py", line 275, in
from afnipy import lib_apqc_io as laio
File "/opt/afni/24.1.15/afnipy/lib_apqc_io.py", line 105, in
import matplotlib.colors as mcol
ImportError: No module named matplotlib.colors

Originally I thought maybe the default had changed to pythonic, so I added the option for basic in my script, but I'm still getting the same result. I'm running it through slurm at my university, and while I've requested they add matplotlib, I can't add it myself and am therefore stuck.

Thanks,
Kara

You will have to have matplotlib installed somehow if you want the QC HTML pages. Perhaps you can install miniconda to create an environment for your own installation in a subdirectory. This is commonly how it's done on a shared system like a slurm cluster.

Hi-

Ah, I see. I made a recent update that did add a matplotlib dependency in that file, forgetting that it might be a called in a non-Pythonic QC case. Sorry about that, I will look into making that more flexible.

That being said, I can only picture the Pythonic QC as being much nicer to interact with than the basic strategy. There will be more images, they will be more systematic, and clearer. Are you not able to install matplotlib on that computer?

--pt

Hi again, Kara-

I have put in a fix for this, and am starting a build of the updated code. You should be able to update your AFNI and get back to happy APQC HTML results after a couple hours from now when the build is done.

Just as an additional plug for having matplotlib, as Daniel noted you should be able to use Miniconda even on a cluster---I have set it up on our Biowulf cluster at NIH, for example. It requires no sudo/admin access, and remains modular/removable. It will basically create a new directory somewhere you have access to (like your in your home directory, by default) and you install whatever dependencies you want as subdirectories there. Using those dependencies is managed by activating environment labels that basically add the relevant directory to your path. If at any point you want to get rid of it, you can basically delete it and the text it puts into your ~/.*rc files. We have notes on the setup and using it with AFNI here.

Anyways, it is just something to consider, but hopefully you will be able to process like normal again shortly. Sorry again for the hassle.

--pt

Sounds good, thank you both! I really appreciate the explanation regarding miniconda; I will definitely have to look into that. Will probably save me a lot of headaches in the future. Thanks!