Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to do conda init and activate environment without changing $HOME/.profile or $HOME/.bashrc? #376

Open
thiagocrepaldi opened this issue Nov 7, 2024 · 3 comments

Comments

@thiagocrepaldi
Copy link

My company does not allow changes to $HOME/.profile or $HOME/.bashrc, so I can't use this extension without an alternative way of initializing/activating conda

@jaimergp
Copy link
Member

jaimergp commented Nov 8, 2024

You can run source $CONDA/etc/profile.d/conda.sh on every step.

@thiagocrepaldi
Copy link
Author

thiagocrepaldi commented Nov 8, 2024

You can run source $CONDA/etc/profile.d/conda.sh on every step.

Thanks, this is helpful. Then I also need to do conda activate myenv in every step too?

could source $CONDA/etc/profile.d/conda.sh be set as the default shell of the github workflow? that would solve the problem

@jaimergp
Copy link
Member

jaimergp commented Nov 8, 2024

Check options in https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html. Either --rcfile or BASH_ENV look promising.

Then I also need to do conda activate myenv in every step too?

Yes, but you can also add that to the conda.sh script I guess?

echo "conda activate myenv" >> $CONDA/etc/profile.d/conda.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants