AFNI Installation Issue (Apple MacBook Air M2, macOS 13.6.9)

Hi everyone, I’m new to AFNI and am running into some permission errors during the installation process. I’ve included the output from the check-up below. Could someone please assist me with this issue?

<user>@dhcp-10-8-032-137 ~ % cd abin
<user>@dhcp-10-8-032-137 abin % python afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             arm (uname -m == arm64)
system:               Darwin
release:              22.6.0
version:              Darwin Kernel Version 22.6.0: Mon Jun 24 01:20:40 PDT 2024; root:xnu-8796.141.3.706.2~1/RELEASE_ARM64_T8112
distribution:         13.6.9
number of CPUs:       8
apparent login shell: zsh
shell RC file:        .zshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           :
                     : 
AFNI_version.txt     : AFNI_24.2.03, anyos_text, Aug 20 2024, local
which python         : /opt/homebrew/anaconda3/bin/python
python version       : 3.12.2
which R              : /usr/local/bin/R
R version            : R version 4.3.1 (aarch64-apple-darwin20)

instances of various programs found in PATH:
    afni    : 0 
    R       : 1   (/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/bin/R)
    python  : 2 
      /opt/homebrew/anaconda3/bin/python3.12
      /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/bin/python3.12
    python2 : 0 
    python3 : 3 
      /opt/homebrew/anaconda3/bin/python3.12
      /opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/bin/python3.12
      /usr/bin/python3

** have python3 but not python2

testing ability to start various programs...
    afni                 : FAILURE
        /bin/sh: afni: command not found
    suma                 : FAILURE
        /bin/sh: suma: command not found
    3dSkullStrip         : FAILURE
        /bin/sh: 3dSkullStrip: command not found
    3dAllineate          : FAILURE
        /bin/sh: 3dAllineate: command not found
    3dRSFC               : FAILURE
        /bin/sh: 3dRSFC: command not found
    SurfMesh             : FAILURE
        /bin/sh: SurfMesh: command not found
    3dClustSim           : FAILURE
        /bin/sh: 3dClustSim: command not found
    uber_subject.py      : success
    3dMVM                : FAILURE
        Error in library(data.table) : there is no package called ‘data.table’
        Calls: source ... suppressPackageStartupMessages -> withCallingHandlers -> library
        Execution halted

have failures, testing programs under implied /Users/<user>/abin...
    afni                 : FAILURE
        /bin/sh: /Users/<user>/abin/afni: No such file or directory
    suma                 : FAILURE
        /bin/sh: /Users/<user>/abin/suma: No such file or directory
    3dSkullStrip         : FAILURE
        /bin/sh: /Users/<user>/abin/3dSkullStrip: No such file or directory
    3dAllineate          : FAILURE
        /bin/sh: /Users/<user>/abin/3dAllineate: No such file or directory
    3dRSFC               : FAILURE
        /bin/sh: /Users/<user>/abin/3dRSFC: No such file or directory
    SurfMesh             : FAILURE
        /bin/sh: /Users/<user>/abin/SurfMesh: No such file or directory
    3dClustSim           : FAILURE
        /bin/sh: /Users/<user>/abin/3dClustSim: No such file or directory
    uber_subject.py      : success
    3dMVM                : FAILURE
        Error in library(data.table) : there is no package called ‘data.table’
        Calls: source ... suppressPackageStartupMessages -> withCallingHandlers -> library
        Execution halted

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /opt/X11/bin/Xvfb

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

R RHOME : /Library/Frameworks/R.framework/Resources

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
   module file : /opt/homebrew/anaconda3/lib/python3.12/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.4

++ module loaded: flask
   module file : /opt/homebrew/anaconda3/lib/python3.12/site-packages/flask/__init__.py
   flask version : 3.0.3

** failed to load module flask_cors
-- flask_cors is not required, but is desirable

-------------------------------- env vars --------------------------------
PATH                       = /opt/homebrew/anaconda3/bin:/Users/<user>/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/python/libexec/bin:/opt/homebrew/opt/python/libexec/bin:/opt/homebrew/opt/python/libexec/bin:/Users/<user>/abin/

PYTHONPATH                 = 
R_LIBS                     = 
LD_LIBRARY_PATH            = 
DYLD_LIBRARY_PATH (sub-shell) = 
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 
CONDA_SHLVL                = 
CONDA_DEFAULT_ENV          = 
CC                         = 

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

    .afnirc                   : missing
    .sumarc                   : missing
    .afni/help/all_progs.COMP : missing

--------- shell startup files ----------

   -- no .tcshrc, will create one as a follower of .cshrc
   -- considered operations: path, apsearch
   
   -- note: followers should not need edits, so edit flags should be 0
      (have 1 follower(s), which can be ignored)
   
   dot file test : want 3 modifications across 3 files:
   
      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .cshrc           1     0        1               0     
      .tcshrc          0     0        0               1     
      .zshrc           0     0        1               0     
   
------------------------------ 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 .

------------------------------ OS specific -------------------------------
XQuartz version      : 2.8.5

which brew           : /opt/homebrew/bin/brew
brew version         : Homebrew 4.3.18


=========================  summary, please fix:  =========================
*  CPU differs between python and uname?
*  just be aware: login shell 'zsh', but our code examples use 'tcsh'
*  missing program: afni
*  failure under initial "AFNI and related program tests"
*  AFNI programs show FAILURE
*  consider adding /Users/<user>/abin to your PATH
*  missing R packages (see rPkgsInstall)
*  please run: cp /Users/<user>/abin//AFNI.afnirc ~/.afnirc
*  please run: "suma -update_env" for .sumarc
*  please run: apsearch -update_all_afni_help
*  dot file test : want 3 modifications across 3 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)
*  consider installing gcc under homebrew
*  consider installing glib under homebrew

<user>@dhcp-10-8-032-137 abin % python init_user_dotfiles.py -test


-- no .tcshrc, will create one as a follower of .cshrc
-- considered operations: path, flatdir, apsearch

-- note: followers should not need edits, so edit flags should be 0
   (have 1 follower(s), which can be ignored)

dot file test : want 7 modifications across 5 files:

   file             path  flatdir  apsearch        follower
   ---------------  ----  -------  --------        --------
   .bashrc          0     1        0               0     
   .cshrc           1     1        0               0     
   .tcshrc          0     0        0               1     
   .profile         1     1        0               0     
   .zshrc           0     1        1               0     

<user>@dhcp-10-8-032-137 abin % ls -al ~/.tcshrc
ls: /Users/<user>/.tcshrc: No such file or directory

If that matters, I have previously installed several programs including homebrew, anaconda, docker, freesurfer, fmriprep, and R.

My $PATH currently looks like this, if echoed:

/opt/homebrew/anaconda3/bin:/Users/<user>/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/python/libexec/bin

Thanks!

Hi-

I don't see anything with "abin" in your PATH, so either those AFNI install updates have not been set, or they havebut your shell has not re-read its ~/.*rc command file to know about those updates. I suspect the latter might be the case here. Can you open up a new terminal (so the shell's command file will be read), and run:

afni_system_check.py -check_all

... and then copy+paste that result here?

Also, that command should not need to be run from abin itself. That is a sign of the PATH information not being updated, itself.

--pt

Even if I re-open my terminal, abin doesn't show up in my $PATH.

<user>@dhcp-10-8-032-137 ~ % afni_system_check.py -check_all
zsh: command not found: afni_system_check.py
<user>@dhcp-10-8-032-137 ~ % echo $PATH
/opt/homebrew/anaconda3/bin:/Users/<user>/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/homebrew/opt/python/libexec/bin

I think there is an issue with the third installation file. This is the output I get:

<user>@dhcp-10-8-032-137 ~ % tcsh OS_notes.macos_12_ARM_b_user.tcsh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3521  100  3521    0     0  22075      0 --:--:-- --:--:-- --:--:-- 22144
set os = `uname -s`
uname -s
if ( 0 ) then
if ( Darwin != Darwin ) then
set cpu = `uname -m`
uname -m
if ( 0 ) then
set rver = `R --version | head -n 1 | cut -d ' ' -f 3`
R --version
cut -d   -f 3
head -n 1
if ( 0 ) then
echo OS    : Darwin
OS    : Darwin
echo CPU   : arm64
CPU   : arm64
echo R ver : 4.3.1
R ver : 4.3.1
echo 

defaults write org.macosforge.xquartz.X11 wm_ffm -bool true
defaults write org.x.X11 wm_ffm -bool true
defaults write com.apple.Terminal FocusFollowsMouse -string YES
curl -O https://afni.nimh.nih.gov/pub/dist/bin/misc/@update.afni.binaries
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 53097  100 53097    0     0  85816      0 --:--:-- --:--:-- --:--:-- 85917
tcsh @update.afni.binaries -no_recur -package anyos_text_atlas -bindir /Users/<user>/abin
-- running @update.afni.binaries version 3.24, December 7, 2023
-- no current AFNI package found in path...
-- any downloads will be from https://afni.nimh.nih.gov via wget

-- attempting to install package anyos_text_atlas under
   install dir: /Users/<user>/abin...
-- have install dir
++ working in new temp dir, .tmp.install
-- skipping update of @update.afni.binaries
++ downloading test file: wget anyos_text_atlas/AFNI_version.txt ...
--2024-08-28 22:27:54--  https://afni.nimh.nih.gov/pub/dist/bin/anyos_text_atlas/AFNI_version.txt
Resolving afni.nimh.nih.gov (afni.nimh.nih.gov)... 156.40.187.114
Connecting to afni.nimh.nih.gov (afni.nimh.nih.gov)|156.40.187.114|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 42 [text/plain]
Saving to: ‘AFNI_version.txt’

     0K                                                       100% 1.08M=0s

2024-08-28 22:27:55 (1.08 MB/s) - ‘AFNI_version.txt’ saved [42/42]

++ no update needed
/Users/<user>/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/<user>/abin
-- no .tcshrc, will create one as a follower of .cshrc
-- considered operations: path, apsearch

-- note: followers should not need edits, so edit flags should be 0
   (have 1 follower(s), which can be ignored)

dot file mods : want 5 modifications across 4 files:

   file             path  flatdir  apsearch        follower
   ---------------  ----  -------  --------        --------
   .bashrc          1     0        0               0     
   .zshrc           1     0        1               0     
   .cshrc           1     0        1               0     
   .tcshrc          0     0        0               1     

-- backing up .bashrc to .bashrc.adot.bak
** failed to open text file '.bashrc' for writing
** error: failed to append shell text to file .bashrc

How should I append .zshrc or .bashrc in order to make things work?