Install Failure on M2 mac

Just to add, I have install matplotlib via python3 but its not showing up

It looks like you have multiple versions of python installed. For example, maybe matplotlib was installed under homebrew's python, but perhaps you are actually running a system python that was previously installed.

What does which python show?

which python

I expect that matplot lib is installed for use with /opt/homebrew/opt/python/libexec/bin/python, but maybe you are running /usr/bin/python. In that case, you might put
/opt/homebrew/opt/python/libexec/bin first in the PATH.

  • rick

you are right... my python is in /usr/local/bin/python

not sure what to do...

You can either "pip install matplotlib" right now, which would install it for the current python (which is probably fine), or be sure that /opt/homebrew/opt/python/libexec/bin is first in the PATH in your .cshrc file, and then open a new terminal window.

It should not really matter whether you use the system python or the one from homebrew. If you are unsure, then do another "pip install matplotlib". If you do use the system python, the brew version could be uninstalled.

  • rick

When i try pip install matplotlib it says pip: Command not found.

pip3 install matplotlib works fine

Great! Hopefully all is well now, yes?

Thanks,

  • rick

Unfortunately for me I still get the details below when i run afni_system_check.py -check_all

=========================  summary, please fix:  =========================
*  missing R packages (see rPkgsInstall)
*  python library matplotlib is required
   (see AFNI install docs for details)
*  dot file test : want 1 modifications across 2 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)
*  please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in tcsh

Currently I have

=========================  summary, please fix:  =========================
*  python library matplotlib is required
   (see AFNI install docs for details)
*  dot file test : want 1 modifications across 2 files:
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)
*  please set DYLD_LIBRARY_PATH to /opt/X11/lib/flat_namespace in tcsh

Thank you

Would you show more information about matplotlib from the system_check output? It seems like it was installed for both versions of python, so the only real question would be of the versions that were installed. But it ought to be there in some form.

Also, are you coming the AFNI bootcamp? If not, the rest of this output is fine.

  • rick

Yes, I will be in the bootcamp 23-27th

Currently I can open AFNI and SUMA
But I wanted to get busy before arriving for the bootcamp

Thanks for the support

Not sure if this is the reason but I had map my python3 and pip3 to python and pip ealier

echo "alias python=/usr/local/bin/python3" >> ~/.zshrc
echo "alias pip=/usr/local/bin/pip3" >> ~/.zshrc

Using an alias for python is dangerous, and you might reaping the "benefits". The PATH update that we give for python under homebrew is because there is an actual 'python' file there. At this point, you could try commenting those out and starting a new shell (and being sure they are not still set). Then see what the system_check output shows.

On the flip side, an alias should not affect a zsh script (as far as I know), and you are not using zsh personally, so maybe the aliases are completely irrelevant.

I will send you a private message about this, and maybe we can talk more directly to resolve this.

  • rick

Oh, and your /usr/local/bin/python is also a link to /usr/bin/python3. Did you make that or did it come from that old python install process?

  • rick

Thanks for your help Rick

This issue is resolved!

Sure thing, I'm glad we got it working!

Dear Rick,

I followed the same instructions you gave to ismailukman, and now everything works!

Thanks!

1 Like

That is great, meytalw, thanks for the update!

  • rick

Hi rickr,

I encountered similar problem on a MAC M3max somona 14.5 when i run (tcsh OS_notes.macos_12_ARM_b_user.tcsh), I got messages as following:

afni_system_check.py -check_all
tee out.ASC.txt
-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             arm (uname -m == arm64)
system:               Darwin
release:              23.5.0
version:              Darwin Kernel Version 23.5.0: Wed May  1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031
distribution:         14.5
number of CPUs:       16
apparent login shell: zsh  (current shell is tcsh)
** 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/tianx/abin/afni
afni version         : Precompiled binary macos_13_ARM_clang: Jul 31 2024 
                     : AFNI_24.2.01 'Macrinus'
AFNI_version.txt     : AFNI_24.2.01, macos_13_ARM_clang, Jul 31 2024, build
which python         : /Users/tianx/anaconda3/bin/python
python version       : 3.11.8
which R              : /usr/local/bin/R
R version            : R version 4.3.1 (aarch64-apple-darwin20)

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

** have python3 but not python2

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           : /bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /opt/X11/bin/Xvfb

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

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

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

++ module loaded: matplotlib.pyplot
   module file : /Users/tianx/anaconda3/lib/python3.11/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.0

++ module loaded: flask
   module file : /Users/tianx/anaconda3/lib/python3.11/site-packages/flask/__init__.py
   flask version : 2.2.5

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

-------------------------------- env vars --------------------------------
PATH                       = /Users/tianx/anaconda3/bin:/Users/tianx/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/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/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin:/Users/tianx/abin

PYTHONPATH                 = 
R_LIBS                     = /Users/tianx/sw/R-4.3.1
LD_LIBRARY_PATH            = 
DYLD_LIBRARY_PATH (sub-shell) = 
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 
CONDA_SHLVL                = 0
CONDA_DEFAULT_ENV          = base
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, 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 3 dot files
   
------------------------------ 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 /Users/tianx/abin

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

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

-- consider installing gcc under homebrew
-- consider installing glib under homebrew

=========================  summary, please fix:  =========================
*  CPU differs between python and uname?
*  just be aware: login shell 'zsh', but our code examples use 'tcsh'
*  have both .cshrc and .tcshrc, with former not applied
   (consider adding 'source $HOME/.cshrc' to $HOME/.tcshrc)
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

echo 

echo to use AFNI now (in zsh), start with:
to use AFNI now (in zsh), start with:
echo    source ~/.zshrc
   source ~/.zshrc
echo 

I then followed the instructions and installed flask_cors in Python. However, when I tried to rerun OS_notes.macos_12_ARM_b_user.tcsh, it did not work. I also saved the log file but haven't figured out how to send it to you as a private message. :)

Could you please help me with a solution?

Thanks,

Cristelle

Hi Cristelle,

If you have installed flask_cors, it should be enough to re-run the system check.
What does that output show now?

afni_system_check.py -check_all

Thanks,

  • rick

Hi Rick,
Thanks for your reply, I run the "afni_system_check.py -check_all", then got

-------------------------------- general ---------------------------------
architecture:         64bit 
cpu type:             arm (uname -m == arm64)
system:               Darwin
release:              23.5.0
version:              Darwin Kernel Version 23.5.0: Wed May  1 20:17:33 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6031
distribution:         14.5
number of CPUs:       16
apparent login shell: zsh
shell RC file:        .zshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /Users/tianx/abin/afni
afni version         : Precompiled binary macos_13_ARM_clang: Jul 31 2024 
                     : AFNI_24.2.01 'Macrinus'
AFNI_version.txt     : AFNI_24.2.01, macos_13_ARM_clang, Jul 31 2024, build
which python         : /Users/tianx/anaconda3/bin/python
python version       : 3.11.8
which R              : /usr/local/bin/R
R version            : R version 4.3.1 (aarch64-apple-darwin20)

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

** have python3 but not python2

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           : /bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /opt/X11/bin/Xvfb

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

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

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

++ module loaded: matplotlib.pyplot
   module file : /Users/tianx/anaconda3/lib/python3.11/site-packages/matplotlib/pyplot.py
   matplotlib version : 3.8.0

++ module loaded: flask
   module file : /Users/tianx/anaconda3/lib/python3.11/site-packages/flask/__init__.py
   flask version : 2.2.5

++ module loaded: flask_cors
   module file : /Users/tianx/anaconda3/lib/python3.11/site-packages/flask_cors/__init__.py
   flask_cors version : 4.0.1

-------------------------------- env vars --------------------------------
PATH                       = /Users/tianx/anaconda3/bin:/Users/tianx/anaconda3/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/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/Apple/usr/bin:/opt/homebrew/opt/python/libexec/bin:/Users/tianx/abin

PYTHONPATH                 = 
R_LIBS                     = /Users/tianx/sw/R-4.3.1
LD_LIBRARY_PATH            = 
DYLD_LIBRARY_PATH (sub-shell) = 
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = 
CONDA_SHLVL                = 1
CONDA_DEFAULT_ENV          = base
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, 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 3 dot files
   
------------------------------ 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 /Users/tianx/abin

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

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

-- consider installing gcc under homebrew
-- consider installing glib under homebrew

=========================  summary, please fix:  =========================
*  CPU differs between python and uname?
*  just be aware: login shell 'zsh', but our code examples use 'tcsh'
*  insufficient data for AFNI bootcamp
   (see "Prepare for Bootcamp" on install pages)

Thanks a lot!