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

Setting environment variables when activating conda env #92

Open
nhz2 opened this issue May 30, 2023 · 3 comments
Open

Setting environment variables when activating conda env #92

nhz2 opened this issue May 30, 2023 · 3 comments

Comments

@nhz2
Copy link

nhz2 commented May 30, 2023

Conda packages can have scripts to set and unset environment variables when the environment is activated and deactivated.

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#saving-environment-variables

These get added to .CondaPkg/env/etc/conda/activate.d/ and .CondaPkg/env/etc/conda/deactivate.d/

Currently from what I can tell CondaPkg.withenv(f::Function) doesn't run these scripts.

@nhz2 nhz2 changed the title Set environment variables when activating conda env Setting environment variables when activating conda env May 30, 2023
@cjdoris
Copy link
Collaborator

cjdoris commented Jun 2, 2023

Indeed, most Conda packages do not use this feature, so it hasn't been implemented by CondaPkg.

Are there particular packages you're having issue with.

@nhz2
Copy link
Author

nhz2 commented Jun 2, 2023

I had issues using the quarto package. But looking into this issue more, I have no idea how actually to fix this in Julia, (besides some super hacky workarounds to try and parse .bat and .sh scripts).

It would probably be easier to fix the quarto conda package instead.

@cjdoris
Copy link
Collaborator

cjdoris commented Jun 5, 2023

Indeed, an earlier version of CondaPkg did this, but it was not super reliable. It could be reimplemented though.

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