R packages and python library matplotlib in mac OS M1

I am almost done with the AFNI installation on a mac OS, but I still get the following "please fix" messages
========================= summary, please fix: =========================

  • have both .cshrc and .tcshrc, with former not applied
    (consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
  • missing R packages (see rPkgsInstall)
  • python library matplotlib is required
    (see AFNI install docs for details)
  • please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in csh

I think I can ignore the first and last message (Unsure how to set DYLD_LIBRARY_PATH - #3 by witherscp). However, I have tried installing again the rPkgsInstall and matplotlib and the "please fix" messages still appear. When checking the R --version, I receive the following output R version 3.6.3 (2020-02-29). I am wondering if perhaps this is due to the incompatible versions mentioned here: Xvfb and matplotlib missing - #2 by dglen

Here is the afni_check_system.py output:
-------------------------------- general ---------------------------------
architecture: 64bit Mach-O
cpu type: arm64
system: Darwin
release: 23.6.0
version: Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000
distribution: 14.7.1
number of CPUs: 8
apparent login shell: tcsh (current shell is csh)
** have both .cshrc and .tcshrc, with former not applied
(consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
shell RC file: .tcshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/add8/abin/afni
afni version : Precompiled binary macos_10.12_local: Dec 6 2024
: AFNI_24.3.08 'Elagabalus'
AFNI_version.txt : AFNI_24.3.08, macos_10.12_local, Dec 06 2024, official
which python : /opt/homebrew/opt/python/libexec/bin/python
python version : 3.13.1
which R : /usr/local/bin/R
R version : R version 3.6.3 (x86_64-apple-darwin15.6.0)

instances of various programs found in PATH:
afni : 1 (/Users/add8/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 1 (/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/bin/python3.13)
python2 : 0
python3 : 2
/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/bin/python3.13
/usr/bin/python3

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

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

which tcsh : /opt/homebrew/bin/tcsh
tcsh version : 6.24.14
which Xvfb : /opt/X11/bin/Xvfb

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

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: phia!
    These packages are not installed on the computer: lme4!
    These packages are not installed on the computer: lmerTest!
    These packages are not installed on the computer: gamm4!
    These packages are not installed on the computer: psych!
    These packages are not installed on the computer: brms!
    These packages are not installed on the computer: metafor!

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

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

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required

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

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

-------------------------------- env vars --------------------------------
PATH = /Applications/NEURON/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Applications/NEURON/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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/X11/bin:/Library/TeX/texbin:/opt/homebrew/opt/python/libexec/bin:/Users/add8/abin:/opt/homebrew/opt/python/libexec/bin:/Users/add8/abin/

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

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

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

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

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

-- good: .cshrc seems to contain 'source .tcshrc'
-- 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)

no modifications needed across 2 dot files

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME (471482M Avail)
top history: 08 Nov 2024 [rickr/ptaylor]: add afni/bad_scripts
data dir : found AFNI_demos under $HOME
top history: 07 Nov 2024 [rickr]: shrank AFNI_pamenc tree
data dir : found suma_demo under $HOME
top history: ...s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/add8/abin

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

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

++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
-- found 'libXt' dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'csh'...
** env var DYLD_LIBRARY_PATH not set to contain /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • have both .cshrc and .tcshrc, with former not applied
    (consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
  • missing R packages (see rPkgsInstall)
  • python library matplotlib is required
    (see AFNI install docs for details)
  • please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in csh

Have you tried that conda install method in your link to the previous thread?

Yes, and I get the following error

[XCV6Y97J52:~] add8% conda create -y
CondaValueError: The target prefix is the base prefix. Aborting.

So I tried the following based on this

conda env create -y
usage: conda-env [-h] {create,export,list,remove,update,config} ...
conda-env: error: unrecognized arguments: -y
[XCV6Y97J52:~] add8% -n py39_afni_tiny
-n: Command not found.

Sorry. The formatting lost the backslashes at the ends of the lines, and you were only getting the partial command on the first line. I've added them in, so a new copy and paste should work.

I first updated anaconda (because I was running an older version...), then I ran the configuration commands you posted in the previous thread. However, I am still obtaining the same list of "summary, please fix" when I run afni_system_check.py -check_all. Do you have any other suggestions to fix these issues?

-------------------------------- general ---------------------------------
architecture: 64bit Mach-O
cpu type: arm64
system: Darwin
release: 23.6.0
version: Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000
distribution: 14.7.1
number of CPUs: 8
apparent login shell: tcsh (current shell is csh)
** have both .cshrc and .tcshrc, with former not applied
(consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
shell RC file: .tcshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/add8/abin/afni
afni version : Precompiled binary macos_10.12_local: Dec 6 2024
: AFNI_24.3.08 'Elagabalus'
AFNI_version.txt : AFNI_24.3.08, macos_10.12_local, Dec 06 2024, official
which python : /opt/homebrew/opt/python/libexec/bin/python
python version : 3.13.1
which R : /usr/local/bin/R
R version : R version 3.6.3 (x86_64-apple-darwin15.6.0)

instances of various programs found in PATH:
afni : 1 (/Users/add8/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 1 (/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/bin/python3.13)
python2 : 0
python3 : 2
/opt/homebrew/Cellar/python@3.13/3.13.1/Frameworks/Python.framework/Versions/3.13/bin/python3.13
/usr/bin/python3

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

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

which tcsh : /opt/homebrew/bin/tcsh
tcsh version : 6.24.14
which Xvfb : /opt/X11/bin/Xvfb

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

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: phia!
    These packages are not installed on the computer: lme4!
    These packages are not installed on the computer: lmerTest!
    These packages are not installed on the computer: gamm4!
    These packages are not installed on the computer: psych!
    These packages are not installed on the computer: brms!
    These packages are not installed on the computer: metafor!

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

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

** failed to load module matplotlib.pyplot
-- matplotlib.pyplot is required

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

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

-------------------------------- env vars --------------------------------
PATH = /Applications/NEURON/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Applications/NEURON/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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/X11/bin:/Library/TeX/texbin:/opt/homebrew/opt/python/libexec/bin:/Users/add8/abin:/opt/homebrew/opt/python/libexec/bin:/Users/add8/abin/

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

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

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

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

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

-- good: .cshrc seems to contain 'source .tcshrc'
-- 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)

no modifications needed across 2 dot files

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME (471482M Avail)
top history: 08 Nov 2024 [rickr/ptaylor]: add afni/bad_scripts
data dir : found AFNI_demos under $HOME
top history: 07 Nov 2024 [rickr]: shrank AFNI_pamenc tree
data dir : found suma_demo under $HOME
top history: ...s_New/data/Build_tmp on Mon Mar 4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/add8/abin

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

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

++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
-- found 'libXt' dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
-- recent OS X, cheating to check DYLD_LIBRARY_PATH in cur shell 'csh'...
** env var DYLD_LIBRARY_PATH not set to contain /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • have both .cshrc and .tcshrc, with former not applied
    (consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
  • missing R packages (see rPkgsInstall)
  • python library matplotlib is required
    (see AFNI install docs for details)
  • please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in csh

I'm wondering if it is a dependency issue. I uninstalled all the R packages and installed them manually (example 2 from here) and it said they were installed correctly. However, I keep obtaining a FAILURE when checking rPkgsInstall and the same 4 "please fix".

Make sure to activate the environment you just created with

conda activate py39_afni_tiny`

and then do the R package installation. Also, that conda example left out the flask and flask-cors option. You can add them to the existing conda environment with:

conda install flask flask-cors

Hello,

You are on a 14.7 ARM mac system, but are using the macos_10.12_local AFNI package (which is built on an Intel mac running only macos 10.12). It would be good to start with the macos ARM install instructions, much of which you have probably done already.
Your R version for the old 3.6 version is also Intel. Would you like to use a modern ARM version of R? Does it matter?

  • rick