OldGrumpyViking / hatch-conda

Hatch plugin for conda environments
MIT License
38 stars 8 forks source link

Hatch ignoring conda environment in custom prefix #25

Closed Anchorfall closed 9 months ago

Anchorfall commented 9 months ago

I'm new to Hatch, so this may just be a case of misuse. But it seems that "hatch run" is not loading the conda environment I created, from the prefix I specified.

Excerpt from pyproject.toml:

[tool.hatch.envs.default] type = "conda" environment-file = "env.yml" command = "conda" prefix = "../env/"

This creates the conda environment in ../env/ successfully, but then I get this error on "hatch run":

EnvironmentLocationNotFound: Not a conda environment: /path-to-projects-folder/mypackage_default_3.9

That path is where the conda environment was initially being installed, before I added the "prefix" key to the TOML file above. For some reason, it still expects the conda environment to be there, rather than in ../env.

In summary, the expected behavior is that hatch loads the conda environment from the custom prefix we gave it, rather than from the old default location. Let me know if more details are needed.