0

I've been having some issue with conda lately (e.g. difficulties installing it despite following the instructions online or uninstalling it with (the official) instructions online) and I don't know why. It also installed itself at ~/opt for some reason.

The main one right now is that despite me telling it to create an env with python 3.7 it uses python 2.7 when I use the python command. e.g.

(automl) brandBrandoParetoopareto~/higher/higher $ python
Python 2.7.10 (default, Oct  6 2017, 22:29:07) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

I know I can just do python3.7 BUT I've never had this issue before. When I create an env with the python version I want:

conda create -n automl python=3.7

it create that version and uses that version automagically with no problem. Is the issue that the installing is located at a weird location? Or something else went wrong with the installation? I am hoping that fixing that is the only installation issue I need to fix....


My path:

(automl) brandBrandoParetoopareto~ $ echo $PATH
/Users/brandBrandoParetoopareto/.pyenv/bin:/Users/brandomiranda/anaconda3/bin:/Users/brandBrandoParetoopareto/.gem/ruby/2.6.0/bin:/usr/local/opt/ruby/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/brandBrandoParetoopareto/opt/miniconda3/envs/automl/bin:/Users/brandBrandoParetoopareto/opt/miniconda3/condabin:/Users/brandBrandoParetoopareto/.pyenv/bin:/Users/brandomiranda/anaconda3/bin:/Users/brandBrandoParetoopareto/.gem/ruby/2.6.0/bin:/usr/local/opt/ruby/bin:/Users/brandBrandoParetoopareto/bin#:/Users/brandBrandoParetoopareto/bin/Maude-2.7.1-osx:/Users/brandBrandoParetoopareto/bin#:/Users/brandBrandoParetoopareto/bin/Maude-2.7.1-osx

and my .bash_profile:

(automl) brandBrandoParetoopareto~ $ cat .bash_profile 
if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

# added by Miniconda3 4.3.11 installer
# export PATH="/Users/brandomiranda/miniconda3/bin:$PATH"  # commented out by conda initialize

# opam configuration
test -r /Users/brandomiranda/.opam/opam-init/init.sh && . /Users/brandomiranda/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/brandomiranda/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/brandomiranda/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/brandomiranda/anaconda3/etc/profile.d/conda.sh"  # commented out by conda initialize
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/brandomiranda/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/brandBrandoParetoopareto/opt/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/brandBrandoParetoopareto/opt/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/brandBrandoParetoopareto/opt/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/brandBrandoParetoopareto/opt/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
  • some partial answers: https://stackoverflow.com/a/60902863/1601580 that ended up fixing it for me. Not sure why conda was acting weird in the first place or installing things wrongly in the first place though... – Charlie Parker Mar 28 '20 at 17:03
  • Doesn't _When I create an env with the python version I want: `conda create -n automl python=3.7` it create that version and uses that version automagically with no problem_ contradict _despite me telling it to create an env with python 3.7 it uses python 2.7 when I use the python command_ ? – AMC Mar 30 '20 at 22:53
  • It also looks like you have both Anaconda and Miniconda installed, or at least the activation stuff for both is in your .bashrc, that certainly can't be helping things. – AMC Mar 30 '20 at 22:54

0 Answers0