Skip to content

Commit f19d292

Browse files
committed
Fix detection of conda executable.
Previously the (which conda) was returning, on macos, some garbage shell function or alias, leading to this mess: JULIA_CONDAPKG_BACKEND=Null JULIA_CONDAPKG_EXE=conda () { \local cmd="${1-__missing__}" case "$cmd" in (activate | deactivate) __conda_activate "$@" ;; eturn (install | update | upgrade | remove | uninstall) __conda_exe "$@" || __conda_activate reactivate ;; (*) __conda_exe "$@" ;; esac } JULIA_PYTHONCALL_EXE=/Users/rwest/miniconda3/envs/rmg_env15/bin/python PYTHON_JULIAPKG_EXE=/Users/rwest/.juliaup/bin/julia PYTHON_JULIAPKG_PROJECT=/Users/rwest/miniconda3/envs/rmg_env15/julia_env which totally messed up the conda environment, making it impossible to activate. This method now finds the actual conda excutable.
1 parent 85ede7d commit f19d292

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

install_rms.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ fi
9999

100100
# Set environment variables for the current environment, for future uses
101101
# https://juliapy.github.io/PythonCall.jl/stable/pythoncall/#If-you-already-have-Python-and-required-Python-packages-installed
102+
# Find the actual conda executable (not the shell function)
103+
CONDA_EXE="${CONDA_EXE:-$(conda info --base)/bin/conda}"
102104
conda env config vars set JULIA_CONDAPKG_BACKEND=Null
103-
conda env config vars set JULIA_CONDAPKG_EXE=$(which conda)
105+
conda env config vars set JULIA_CONDAPKG_EXE="$CONDA_EXE"
104106
conda env config vars set JULIA_PYTHONCALL_EXE=$CONDA_PREFIX/bin/python
105107
conda env config vars set PYTHON_JULIAPKG_EXE=$(which julia)
106108
conda env config vars set PYTHON_JULIAPKG_PROJECT=$CONDA_PREFIX/julia_env
107109
# Also export for current shell/session (needed for Docker/non-interactive use)
108110
export JULIA_CONDAPKG_BACKEND=Null
109-
export JULIA_CONDAPKG_EXE="$(which conda)"
111+
export JULIA_CONDAPKG_EXE="$CONDA_EXE"
110112
export JULIA_PYTHONCALL_EXE="$CONDA_PREFIX/bin/python"
111113
export PYTHON_JULIAPKG_EXE="$(which julia)"
112114
export PYTHON_JULIAPKG_PROJECT="$CONDA_PREFIX/julia_env"

0 commit comments

Comments
 (0)