Here is an update.
I went back to Rick’s suggestion, i.e., adding the following command to the terminal/shell in order to assign a new path.
ln -s /usr/local/bin/python3 /usr/local/bin/python
However, the OS then prints a “permission denied”. I googled a bit more and found out that there is the possibility of adding the command “sudo” just before the command that Rick suggested.
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python
The shell then requries to input your admin password and will consequently execute the command. However, people said that this can crash your whole OS. So you should really know what you are doing in such cases, namely when adding the sudo command on commands that are normally blocked by the OS. My reasoning was that since Apple already removed Python 2.7 from the OS anyway, what could go wrong?
I therefore uninstalled the homebrew installation of Python 2.7 again. After a fresh restart of the system afterwards, I used the command suggested by Rick above with adding “sudo” just before it. Now here is the new output of afni_system_check.py -check_all
-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 21.4.0
version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000
distribution: 12.3.1
number of CPUs: 10
apparent login shell: zsh
shell RC file: .zshrc (exists)
--------------------- AFNI and related program tests ---------------------
which afni : /applications/AFNI/abin/afni
afni version : Precompiled binary macos_10.12_local: Apr 4 2022
: AFNI_22.1.01 'Antoninus Pius'
AFNI_version.txt : AFNI_22.1.01, macos_10.12_local, Apr 04 2022
which python : /usr/local/bin/python
python version : 3.10.4
which R : /Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R
R version : R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
which tcsh : /bin/tcsh
instances of various programs found in PATH:
afni : 1 (/applications/AFNI/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.6/Resources/bin/R)
python : 1 (/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10)
python2 : 0
python3 : 3
/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/bin/python3.9
/Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10
/usr/bin/python3
** 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 : /Library/Frameworks/R.framework/Resources
checking for $HOME files...
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found
------------------------------ python libs -------------------------------
** failed to load module PyQt4
-- PyQt4 is no longer needed for an AFNI bootcamp
++ module loaded: matplotlib.pyplot
module file : /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/matplotlib/pyplot.py
matplotlib version : 3.5.1
-- python binaries under /usr/local/bin:
/usr/local/bin/python (sym link to /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10)
/usr/local/bin/python3 (sym link to /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10)
-------------------------------- env vars --------------------------------
PATH = /opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/applications/AFNI/abin:/Library/Frameworks/R.framework/Versions/3.6/Resources/bin
PYTHONPATH =
R_LIBS =
LD_LIBRARY_PATH =
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 /applications/AFNI/abin
------------------------------ OS specific -------------------------------
XQuartz version : 2.8.1
which brew : /opt/homebrew/bin/brew
brew version : Homebrew 3.4.5
-- for PyQt4 under brew, consider running:
brew install cartr/qt4/pyqt
++ found 1 dylib files under '/opt/X11/lib/flat_namespace'
-- found 'libXt' dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
** env var DYLD_LIBRARY_PATH is not set to contain /opt/X11/lib/flat_namespace
(so afni and suma may fail)
========================= summary, please fix: =========================
* just be aware: login shell 'zsh', but our code examples use 'tcsh'
* insufficient data for AFNI bootcamp
(see "Prepare for Bootcamp" on install pages)
* OS X version might be old
* consider setting DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace
As we can see, AFNI now uses Python 3.10.4 and it also finds the up-to-date version of matplotlib which is installed under pip3. The reason why there is also a copy of Python 3.9 on my system is that homebrew tells me upon trying to deinstall it that some packages require Python 3.9. They are probably not yet supported by Python 3.10. Anyway, the problem, at least for now, seems to be fixed!
Edit: ok, I was too optimistic. Inside the preprocessing (using AFNI proc), I now get the following error already for the first despiking block.
3dDespike -NEW -nomask -prefix pb01.Subject1_Rest.r01.despike pb00.Subject1_Rest.r01.tcat+tlrc
dyld[4631]: Library not loaded: /sw/lib/libjpeg.9.dylib
Referenced from: /Applications/AFNI/abin/3dDespike
Reason: tried: '/sw/lib/libjpeg.9.dylib' (no such file), '/usr/local/lib/libjpeg.9.dylib' (no such file), '/usr/lib/libjpeg.9.dylib' (no such file)
Abort