AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
January 19, 2021 11:33AM
Hello pt,

So here are my answers to your questions
- When I type conda env list, the terminal shows that I have python 2.7 activated.
- The reason I showed you the afni_sytem_check results produced in bash, not tcsh (my preferred shell) is that I wanted to let you do a side-by-side comparison of failed and successful results obtained from the same shell. This, because I never had a successful run of the afni_system_check under the tcsh.

And here is what I’ve discovered:
- When I delete the following lines from the .cshrc file, conda no longer works in tcsh, but the afni_system_check again starts to run successfully in bash

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
if ( -f "/Users/achoe2/miniconda3/etc/profile.d/conda.csh" ) then
    source "/Users/achoe2/miniconda3/etc/profile.d/conda.csh"
else
    setenv PATH "/Users/achoe2/miniconda3/bin:$PATH"
endif
# <<< conda initialize <<<


And here is the /Users/achoe2/miniconda3/etc/profile.d/conda.csh

setenv CONDA_EXE "/Users/achoe2/miniconda3/bin/conda"
setenv _CONDA_ROOT "/Users/achoe2/miniconda3"
setenv _CONDA_EXE "/Users/achoe2/miniconda3/bin/conda"
setenv CONDA_PYTHON_EXE "/Users/achoe2/miniconda3/bin/python"
echo "Copyright (C) 2012 Anaconda, Inc" > /dev/null
echo "SPDX-License-Identifier: BSD-3-Clause" > /dev/null

if (! $?_CONDA_EXE) then
  set _CONDA_EXE="${PWD}/conda/shell/bin/conda"
else
  if ("$_CONDA_EXE" == "") then
      set _CONDA_EXE="${PWD}/conda/shell/bin/conda"
  endif
endif

if ("`alias conda`" == "") then
    if ($?_CONDA_EXE) then
        # _CONDA_PFX is named so as not to cause confusion with CONDA_PREFIX
        # If nested backticks were possible we wouldn't use any variables here.
        set _CONDA_PFX=`dirname "${_CONDA_EXE}"`
        set _CONDA_PFX=`dirname "${_CONDA_PFX}"`
        alias conda source "${_CONDA_PFX}/etc/profile.d/conda.csh"
        # And for good measure, get rid of it afterwards.
        unset _CONDA_PFX
    else
        alias conda source "${PWD}/conda/shell/etc/profile.d/conda.csh"
    endif
    setenv CONDA_SHLVL 0
    if (! $?prompt) then
        set prompt=""
    endif
else
    setenv PATH "`dirname ${_CONDA_EXE}`:$PATH"
    switch ( "${1}" )
        case "activate":
            set ask_conda="`(setenv prompt '${prompt}' ; '${_CONDA_EXE}' shell.csh activate '${2}' ${argv[3-]})`" || exit ${status}
            eval "${ask_conda}"
            rehash
            breaksw
        case "deactivate":
            set ask_conda="`(setenv prompt '${prompt}' ; '${_CONDA_EXE}' shell.csh deactivate '${2}' ${argv[3-]})`" || exit ${status}
            eval "${ask_conda}"
            rehash
            breaksw
        case "install" | "update" | "upgrade" | "remove" | "uninstall":
            $_CONDA_EXE $argv[1-]
            set ask_conda="`(setenv prompt '${prompt}' ; '${_CONDA_EXE}' shell.csh reactivate)`" || exit ${status}
            eval "${ask_conda}"
            rehash
            breaksw
        default:
            $_CONDA_EXE $argv[1-]
            breaksw
    endsw
endif


So if this bit of code (conda.csh) is run on the tcsh shell, while the conda can now run(?) in tcsh, the conda no longer responds to the ‘conda activate py27_afni_tiny’ command. In fact, once the conda.csh is run, no matter which environment I activate, the ‘which python’ returns the same path (i.e., /Users/achoe2/miniconda3/bin/python). Prior to running conda.csh, if I activate the py27_afni_tiny, and ask ‘which python’, the path is correctly set for /Users/achoe2/miniconda3/envs/py27_afni_tiny/bin/python.

It pretty clear to me that something wicked is happening with conda.csh, but I don’t know how to fix it.

Wheeeeee (used in the same context as your previous wheee).



Thank you,
Ann
Subject Author Posted

tcsh vs. Miniconda

annschoe January 18, 2021 04:33PM

Re: tcsh vs. Miniconda

ptaylor January 18, 2021 08:25PM

Re: tcsh vs. Miniconda

annschoe January 18, 2021 11:59PM

Re: tcsh vs. Miniconda

ptaylor January 19, 2021 09:09AM

Re: tcsh vs. Miniconda

annschoe January 19, 2021 11:33AM

Re: tcsh vs. Miniconda

ptaylor January 19, 2021 04:25PM