-
Notifications
You must be signed in to change notification settings - Fork 181
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
Don't treat the conda root env as an env #324
Conversation
If I download the anaconda or miniconda distribution, install it in my user directory, and fire it up, the default is to be in the CONDA_ROOT environment, right? Isn't that one of the most common cases for using anaconda? |
Yes, it's the most common and I think it shouldn't get treated like an env. That's why I think it's an important bug to fix. A base anaconda install is more equivalent to a homebrew-installed Python than a virtualenv, in my mind. |
Okay, I agree. On the plus side, that makes the behavior for venv and conda consistent, i.e., the base install is not considered a preferred path. |
Co-authored-by: Jason Grout <[email protected]>
I just installed a fresh install of miniconda on macos, and tried to see what CONDA_ROOT would give me. Here is the base environment:
and here is what a small test environment gives me
Where is CONDA_ROOT? |
huh, I must have confused my own environment variables for conda's! I'll look again at detecting the root env the right way. |
use CONDA_DEFAULT_ENV=base if CONDA_PREFIX is set and CONDA_DEFAULT_ENV is not defined, assume it's the base env (not properly activated as an env)
I think CONDA_ROOT may be years old and no longer used (it's in my bashrc). I cleared all conda envs and started fresh:
So the two logical choices are:
I elected to consider CONDA_DEFAULT_ENV being unset to mean we're not in an env, because that should mean that |
I'm happy to try out this and #323 and wait for feedback. |
for more information, see https://pre-commit.ci
For the purposes of 'preferring env config', I don't think it makes sense to treat the conda root prefix as an environment. This is quite likely to be a shared, not writable installation, and it would be more consistent to be treated like any other base Python install.
related: #318