mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-13 22:13:52 -05:00
exits as error if the virtual environment doesn't have python executable (#104)
conda's environment might not have `python` executable. If the prefix doesn't contain `python` in it, `pyenv-which` might be ran into infinite loop if some of `which` hooks invoke `pyenv-virtualenv-prefix`.
This commit is contained in:
@@ -123,12 +123,16 @@ create_conda() {
|
||||
mkdir -p "${PYENV_ROOT}/versions/$version/bin"
|
||||
touch "${PYENV_ROOT}/versions/$version/bin/activate"
|
||||
touch "${PYENV_ROOT}/versions/$version/bin/conda"
|
||||
touch "${PYENV_ROOT}/versions/$version/bin/python"
|
||||
chmod +x "${PYENV_ROOT}/versions/$version/bin/conda"
|
||||
chmod +x "${PYENV_ROOT}/versions/$version/bin/python"
|
||||
local conda_env
|
||||
for conda_env; do
|
||||
mkdir -p "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin"
|
||||
touch "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin/activate"
|
||||
touch "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin/conda"
|
||||
touch "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin/python"
|
||||
chmod +x "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin/conda"
|
||||
chmod +x "${PYENV_ROOT}/versions/$version/envs/$conda_env/bin/python"
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user