-
Notifications
You must be signed in to change notification settings - Fork 104
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-lock picks up the wrong sys_rc_path #743
Comments
Thanks @ctcjab for the well-written issue! For your case, would it make sense to place the |
I changed from /opt/conda/.condarc to /etc/conda/condarc and it fixed this. Thanks for the hint, @maresb! I have filed jupyter/docker-stacks#2173 so that other users of these common base images will hopefully not hit this in the future the way I did. |
Great, thanks for the follow-up! Then this can be closed, right? |
Updating from the docker-stacks report: it is the standard $CONDA_ROOT condarc location that's being ignored. So I think it's up to conda-lock to decide if it is right to ignore the condarc for the conda install of conda-lock itself, but I would consider it at least surprising and perhaps a bug that invoking conda and conda-lock in the same env produce different results. If it's not a bug, it should probably be documented deliberate behavior that your conda config is ignored by conda-lock (but only root config, not current env config, and only if the current env is not the root env, if I've understood the report correctly, which makes me think it's a bug). |
Checklist
What happened?
conda-lock
bundles its own, vendored version ofconda
.conda
calculates thesys_rc_path
(i.e., the system-global condarc) based onsys.prefix
.1As a result,
conda-lock
will not pick up the same global condarc asconda
, unlessconda-lock
happens to be installed in conda's ownbase
environment.Often,
conda-lock
is installed in a different environment, such as when installed viapixi global
, or via apre-commit
hook (as shown in #237 (comment)). In general, it's better to install a global devtool likeconda-lock
in its own private isolated environment that tools likepixi global
can manage for you, rather than put them in conda'sbase
environment, which can result in corrupted or harder-to-upgrade, more error-prone conda installations.This discrepancy is especially challenging when the global condarc needs to contain config like
channel_alias: https://artifactory.mycompany.com/...
andchannels: [mycompany-internal-channel]
(that ideally should not need to be duplicated in every user's ~/.condarc on every host to work around this -- better to keep these settings that user's should not be able to change in a global config file that is not user-writable). When conda-lock has a different sys.prefix and does not pick up this expected global config, solving fails and it is unable to generate lockfiles.Can
conda-lock
add logic to detect when its vendored conda'ssys.prefix
does not match that of the user'sconda
(i.e., the one that gets resolved based on the user'sPATH
), and in this case patch in a correctedsys_rc_path
value?Footnotes
See here for where this happens in the latest release, and here for a more recent, not-yet-released version. ↩
The text was updated successfully, but these errors were encountered: