can not activate conda enviornment in `startup_script`

atif@aihwkit:~$ cat build.log

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'.


atif@aihwkit:~$ conda activate DL
(DL) atif@aihwkit:~$
atif@aihwkit:~$ cat build.log

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'.


atif@aihwkit:~$ conda activate DL
(DL) atif@aihwkit:~$
9 Replies
Atif
Atif3y ago
conda activate works when i login through the web terminal so it ensures that shell has been configured to run conda activate command But this does not work in the template startup_script fixed it by specifying full path of jupyter /home/${data.coder_workspace.me.owner}/miniconda/envs/DL/bin/jupyter notebook --no-browser --NotebookApp.token='' --ip='*' --NotebookApp.base_url=/@${data.coder_workspace.me.owner}/${lower(data.coder_workspace.me.name)}/apps/jupyter-notebook/ 2>&1 | tee -a ~/build.log &
Phorcys
Phorcys3y ago
? oh i see you fixed it already good, because I had no clue of what to do
Atif
Atif3y ago
but I am wondering why the startup_script could not initialize the conda env
Phorcys
Phorcys3y ago
well, did you try doing conda init bash ? in your startup_script
conda init bash
source ~/.bashrc
jupyter [...]
conda init bash
source ~/.bashrc
jupyter [...]
Atif
Atif3y ago
I am doing it while building my image and it adds to .bashrc
Phorcys
Phorcys3y ago
oh well then this should work
Atif
Atif3y ago
also after we run conda init bash we can not activate in the same shell we need to open a new shell or source .bashrc that could work but for now I am using the full path of jupyter and it is working.
Phorcys
Phorcys3y ago
alright mark as resolved if it's good for you
Atif
Atif3y ago
ok
Want results from more Discord servers?
Add your server