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

Activation fails when using env prefix #29

Open
wlhjason opened this issue Feb 20, 2024 · 1 comment
Open

Activation fails when using env prefix #29

wlhjason opened this issue Feb 20, 2024 · 1 comment

Comments

@wlhjason
Copy link

Thanks for creating this handy plugin!

After setting a Conda environment prefix as per the docs here and running hatch env create, I am seeing an error that looks like

EnvironmentLocationNotFound: Not a conda environment: /path/to/cwd/project_default_3.8

Digging into the implementation, it looks like this is because conda activate isn't using the prefix:

cmdl = f"{self.config_command} activate {self.conda_env_name}"

@OldGrumpyViking
Copy link
Owner

Yes this should probably be wrapped in a prefix check:

if self.config_prefix is not None:
    cmdl = f"{self.config_command} activate {self.config_prefix}" 
else:
    cmdl = f"{self.config_command} activate {self.conda_env_name}" 

You are welcome to make the PR.

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