1

I was trying to install miniconda and use it but I get issues on Mac Os. I use their official installation dmg (https://docs.conda.io/en/latest/miniconda.html) and used that to install miniconda. It install it in ~./opt. Then I do:

conda init bash

it says nothing was changed:

(base) brandBrandoParetoopareto~/automl-meta-learning $ conda init bash
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/condabin/conda
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/bin/conda
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/bin/conda-env
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/bin/activate
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/bin/deactivate
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/etc/profile.d/conda.sh
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/etc/fish/conf.d/conda.fish
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/shell/condabin/Conda.psm1
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/shell/condabin/conda-hook.ps1
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /Users/brandBrandoParetoopareto/opt/miniconda3/etc/profile.d/conda.csh
no change     /Users/brandBrandoParetoopareto/.bash_profile
No action taken.

but then when I try to start a new bash session it says their are issues:

(base) brandBrandoParetoopareto~/automl-meta-learning $ bash

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.


brandBrandoParetoopareto~/automl-meta-learning $ 

and then deactivates my previous environment. Why is that?


There is definitively something wrong with this miniconda because when I do:

python script.py

it says there is a syntax error which means its using a different version of python despite me telling my env to use python3.7 why? Why doesn't it use the version I said?


Related question with nearly no details: conda init not initialising new shell

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
  • did you try to fully close your terminal window? `==> For changes to take effect, close and re-open your current shell. <==` – Charlie Parker Mar 28 '20 at 14:55
  • @Pinocchio I see...is it because running `bash` alone does not re-run `.bash_profile`? Most likely. Regardless, the installation of conda is still at `~/opt` which it should not. – Charlie Parker Mar 28 '20 at 15:13
  • 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
  • The `(base)` indicates that you're already inside of a Conda environment, which means the `init` should be unnecessary, no? – AMC Mar 30 '20 at 23:07
  • @amc I honestly forget the details but I still had version of conda going on despite my attempts to uninstall it. The solution I posted is what worked after restarting everything from scratch. – Charlie Parker Mar 31 '20 at 22:47
  • @CharlieParker It seems you've been having a decent amount of problems with Conda, have things improved? – AMC Mar 31 '20 at 22:50
  • @AMC yes! All is good. I tried answering all my questions or the questions that did not help me with the solution that I found (or a link to my answer explaining what solved it, hopefully it will help someone). Thanks for checking though! :) – Charlie Parker Apr 06 '20 at 21:27

1 Answers1

1

As far as I know the best thing is to not trust installations blindly, specially if they modify your files (since figuring out if they are changing your bash code correctly is equivalent to the halting problem). So read the output of the installation and conda init <Shell> carefully. For more detail see this: Why is conda init updating my .bash_profile incorrectly?

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323