-
Notifications
You must be signed in to change notification settings - Fork 57
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
update conda executable location for Linux/macOS #146
Conversation
For changes since [[email protected]#recommended-change-to-enable-conda-in-your-shell](https://github.com/conda/conda/blob/c06cee03757b2946831d8d5006ecffce9eb6d053/docs/source/release-notes.rst#recommended-change-to-enable-conda-in-your-shell), when non-root Conda Environment is used, executable file `conda` will not necessarily exists under `bin_dir(ROOTENV)`, which causing Conda.jl constantly try to install Miniconda. Using environment variable `$CONDA_EXE` to locate `conda` executable is recommend. For example: ```bash # creating non-root conda env conda create -n conda_jl python conda # add following line to `~/.bashrc`, `~/.zshrc` or other rc files to avoid typing everytime export CONDA_JL_HOME="/path/to/miniconda/envs/conda_jl" # rebuild Conda julia -e 'using Pkg; Pkg.build("Conda")' # try to list installed Conda packages julia -e 'using Conda; Conda.list()' # will still trying to install miniconda ``` Test passed with `test Conda`.
Thanks for the PR! Is |
@@ -77,7 +77,11 @@ const conda = if Compat.Sys.iswindows() | |||
conda_bat = joinpath(p, "conda.bat") | |||
isfile(conda_bat) ? conda_bat : joinpath(p, "conda.exe") | |||
else | |||
joinpath(bin_dir(ROOTENV), "conda") | |||
if haskey(ENV, "CONDA_EXE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole if
can be written as get(ENV, "CONDA_EXE", joinpath(bin_dir(ROOTENV), "conda"))
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clean solution, I am still quite new to Julia -- TIL!
You are right, CONDA_EXE
is not documented in the quite obsolete user document, albeit being mentioned in release note.
However conda/conda#7126 (with detailed gitter chat record) might be quite evidential that $CONDA_EXE
is considerably the de facto way to refer to conda executable after conda 4.4+
...
Continuing #146 (comment). Good to know. Thanks for clarification. I just had a look at Conda.jl to refresh my memory and I noticed a few things: First of all, if Also, I think Lines 151 to 153 in 3d84627
I think the right solution is to save the environment variable (say) Lines 36 to 39 in 3d84627
and then just error out in Also, ideally we better check it in |
Perhaps something crudely like: master...Quar:feat_conda_exe Additionally, would it be helpful to add another function (say) Still working on |
Just want to confirm that on a system where I use a non-root environment, e.g.
I need this PR otherwise Conda.jl doesn't work. Not sure if there's other better workarounds or if this should be merged. |
We don't want to use whatever Conda the user might have installed — we want to use specifically the It seems like you guys are referring to the situation where the user has configured Conda.jl with a different |
(Honestly, using |
Having multiple installations of conda actually defeats the purpose of conda; handle multiple environment, centralize resources like download cache, de-duplicate files as much as possible, etc. I sympathise with you that dealing with broken conda environments questions from newbies is not fun. But keeping escape hatch for users already familiar with conda sounds reasonable to me provided that it wouldn't be enabled unless the user explicitly asks for it.
That's why I suggested |
This doesn't seem necessary any longer (in that Conda.jl works well nowadays). Please reopen if still something we should do. |
For changes since [email protected]#recommended-change-to-enable-conda-in-your-shell, when non-root Conda Environment is used, executable file
conda
will not necessarily exists underbin_dir(ROOTENV)
, which causing Conda.jl constantly try to install Miniconda.Using environment variable
$CONDA_EXE
to locateconda
executable is recommend.For example:
Test passed with
test Conda
.