I'm exploring ubuntu and for a small project, I'm writing a .sh
(bash) file that will activate a Conda environment and run a python file. Here is my .sh
file:
#!/bin/sh
conda activate simple_python3.10
python3 code.py
When I run the bash file it conda gives me this warning:
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'.
At this time I don't know what exactly I should do. I did conda init bash
but didn't work. I added conda init bash
to my file but it didn't work. This warning showed up once again. I rebooted my PC too but didn't work. Could you please tell me what exactly I should do?
P.S. Just for the case. This is what I will get after running conda init bash
:
no change /home/p2mohsen/anaconda3/condabin/conda
no change /home/p2mohsen/anaconda3/bin/conda
no change /home/p2mohsen/anaconda3/bin/conda-env
no change /home/p2mohsen/anaconda3/bin/activate
no change /home/p2mohsen/anaconda3/bin/deactivate
no change /home/p2mohsen/anaconda3/etc/profile.d/conda.sh
no change /home/p2mohsen/anaconda3/etc/fish/conf.d/conda.fish
no change /home/p2mohsen/anaconda3/shell/condabin/Conda.psm1
no change /home/p2mohsen/anaconda3/shell/condabin/conda-hook.ps1
no change /home/p2mohsen/anaconda3/lib/python3.9/site-packages/xontrib/conda.xsh
no change /home/p2mohsen/anaconda3/etc/profile.d/conda.csh
no change /home/p2mohsen/.bashrc
No action taken.