afni_python_wrapper.py command not found

-------------------------------- general ---------------------------------
architecture:         64bit ELF
system:               Linux
release:              4.18.0-372.26.1.el8_6.x86_64
version:              #1 SMP Tue Sep 13 18:09:48 UTC 2022
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       16
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /root/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Nov  2 2022 
                     : AFNI_22.3.04 'Lucius Verus'
AFNI_version.txt     : AFNI_22.3.04, linux_ubuntu_16_64, Nov 02 2022
which python         : /usr/bin/python
python version       : 3.10.6
which R              : /usr/bin/R
R version            : R version 4.1.2 (2021-11-01) -- "Bird Hippie"
which tcsh           : /usr/bin/tcsh

instances of various programs found in PATH:
    afni    : 1   (/root/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0 
    python3 : 1   (/usr/bin/python3.10)

** have python3 but not python2

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    uber_subject.py      : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    3dMVM                : success

checking for R packages...
    rPkgsInstall -pkgs ALL -check : success

R RHOME : /usr/lib/R

checking for $HOME files...
    .afnirc                   : missing
    .sumarc                   : missing
    .afni/help/all_progs.COMP : missing

------------------------------ python libs -------------------------------
** failed to load module PyQt4
-- PyQt4 is no longer needed for an AFNI bootcamp

++ module loaded: matplotlib.pyplot
   module file : /usr/lib/python3/dist-packages/matplotlib/pyplot.py
   matplotlib version : 3.5.1

-------------------------------- env vars --------------------------------
PATH = /root/abin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PYTHONPATH = 
R_LIBS = /root/R

LD_LIBRARY_PATH = /.singularity.d/libs

DYLD_LIBRARY_PATH = 
DYLD_FALLBACK_LIBRARY_PATH = 

------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas    : found TT_N27+tlrc  under /root/abin

------------------------------ OS specific -------------------------------
which apt-get        : /usr/bin/apt-get
apt-get version      : apt 2.4.8 (amd64)

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Nov  2 2022 

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  please run: cp /root/abin/AFNI.afnirc ~/.afnirc
*  please run: "suma -update_env" for .sumarc
*  please run: apsearch -update_all_afni_help
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

This is the error code:

++ 3dTstat: AFNI version=AFNI_22.3.04 (Nov  2 2022) [64-bit]
++ Authored by: KR Hammett & RW Cox
*+ WARNING: Input dataset is not 3D+time; assuming TR=1.0
++ Output dataset ./sum_ideal.1D
afni_python_wrapper.py: Command not found.
Traceback (most recent call last):
  File "/root/abin/gen_ss_review_scripts.py", line 3405, in <module>
    sys.exit(main())
  File "/root/abin/gen_ss_review_scripts.py", line 3382, in main
    rv = me.process_options()
  File "/root/abin/gen_ss_review_scripts.py", line 1116, in process_options
    dfill = UTIL.read_json_file(C.udict_in)
  File "/root/abin/afnipy/afni_util.py", line 351, in read_json_file
    return json.loads(textdata)
  File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
execution finished: Fri Jun 20 13:10:37 CDT 2025
tacc-singularity module has been deprecated, loading tacc-apptainer instead.
auto-generated by afni_proc.py, Fri Jun 20 13:03:55 2025
(version 7.47, October 8, 2022)
execution started: Fri Jun 20 13:10:37 CDT 2025
Precompiled binary linux_ubuntu_16_64: Nov  2 2022 (Version AFNI_22.3.04 'Lucius Verus')
-- is current: afni_history as new as: 03 Jun 2022
               most recent entry is:   02 Nov 2022

Any help would be greatly appreciated!!

Howdy-

Thanks for sending the system check info with the question. Your AFNI version is quite old---from 2022. I suspect that updating it will resolve the issue. There have also been a lot of improvements+updates in afni_proc.py's QC HTML in that time.

On your Ubuntu system, I think you should just be able to run:

@update.afni.binaries -d

There are a couple things you can do after that, as well, as listed in the "please fix" section at the end of the system check:

  • get default environment files for AFNI and SUMA, respectively (which you can edit):
     cp /root/abin/AFNI.afnirc ~/.afnirc
    suma -update_env
    
  • Run this to set up tab autocompletion of program help options:
    apsearch -update_all_afni_help
    

It is also possible for the group analysis R programs that you will then perhaps need to update your local R version. There might also be some Python libraries to add (but that will be doable from the command line with the default Ubuntu package manager). We can see what the system check shows with those above updates first.

--pt