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

Conda environment does not activate #134

Open
rstuckey opened this issue Feb 4, 2021 · 1 comment
Open

Conda environment does not activate #134

rstuckey opened this issue Feb 4, 2021 · 1 comment

Comments

@rstuckey
Copy link

rstuckey commented Feb 4, 2021

Hi,

The current method for starting a conda environment local to each node does not work correctly:

from dask_yarn import YarnCluster

# Use a conda environment at /path/to/my/conda/env
cluster = YarnCluster(environment='conda:///path/to/my/conda/env')

It seems the environment does not activate, as discussed here.

I am running dask-yarn 0.8.1.

A possible workaround (I have been using successfully) is to replace line 126 in dask_yarn/core.py:

            setup = "conda activate %s" % path

with the following:

            conda_root, conda_env = path.split("/envs/")
            setup = "source %s/etc/profile.d/conda.sh && conda activate %s" % (conda_root, conda_env)

for environments stored in a standard location such as /opt/anaconda3/envs/my_conda_env.

The cluster can then be then started with:

cluster = YarnCluster(environment='conda:///opt/anaconda3/envs/my_conda_env')

Please let me know if you would like me to submit a PR with the above.

Cheers, Roger

@dkoes
Copy link

dkoes commented Feb 12, 2024

Thank you for this fix! Too bad development seems to have stopped...

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