Resolve system-level .condarc source differences in documentation, conda config initialization, and search path
What is the idea?
(I'm writing this for Windows. There may be similar issues on other platforms but I have not tried.)
-
The documentation on this page and this page and similar pages should be updated to no longer suggest placing .condarc files in the directory where Anaconda was installed, or the "root directory". Instead, it should suggest placing them in a separate folder "C:/ProgramData/conda/".
-
When
conda config --system --set KEY VALUEis run for the first time, the created file should be at C:/ProgramData/conda/.condarc instead of C:/ProgramData/Anaconda3/.condarc or C:/ProgramData/miniconda3/.condarc or whatever the install path was set to.
Why is this needed?
The install paths for an "All Users" installation of Anaconda and Miniconda are not on the search path. Therefore, if a user of a multi-user installation accidentally or intentionally installs conda in one of their user environments, the system .condarc file in the install directory is ignored by conda because it is not on the search path. This is because sys.prefix resolves to the environment prefix where conda is installed by the user.
This allows users to ignore system configuration defaults, as well as override #!final configuration parameters. It is also confusing for administrators trying to set up multi-user installations.
What should happen?
(base) C:\Users\username>conda config --show-sources
==> C:\ProgramData\conda\.condarc <==
Additional Context
To reproduce:
- Place a .condarc file in the base environment directory (where Anaconda or Miniconda was installed for "All Users")
- Run
conda create -n new_env conda - Activate the new environment:
conda activate new_env - Check where configs are found:
conda config --show-sources - Observe that the .condarc file in the install directory is not listed. Any restrictions on channels, packages, etc no longer apply to this environment.
@shaese-auw you're right, this is equally applicable to unix systems as well:
https://github.com/conda/conda/blob/e69b2353c2f14fbfc9fd3aa448ebc991b28ca136/conda/base/constants.py#L28-L42
Windows 10+ no longer has C:\ProgramData. See my closed pull request for suggestions.
Hi there, thank you for your contribution!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.
If you would like this issue to remain open please:
- Verify that you can still reproduce the issue at hand
- Comment that the issue is still reproducible and include: - What OS and version you reproduced the issue on - What steps you followed to reproduce the issue
NOTE: If this issue was closed prematurely, please leave a comment.
Thanks!
I am not sure if this issue was closed prematurely or not. I rarely do anything on GitHub so I am not familiar with the workflow patterns.