ncm2 / ncm2-jedi

MIT License
23 stars 11 forks source link

use $CONDA_PREFIX instead of $CONDA_PYTHON_EXE to detect conda environment. #20

Closed ivechan closed 5 years ago

ivechan commented 5 years ago

Why not use $CONDA_PYTHON_EXE

$CONDA_PYTHON_EXE is the python interpreter for conda itself (aka base environment), not the python interpreter in the active environment.
from: https://github.com/conda/conda/issues/8061#issuecomment-451751989

Using $CONDA_PYTHON_EXE will cause InvalidPythonEnvironment exception here when I use ncm2-jedi under an activated environment created by myself (not the base environment.). https://github.com/ncm2/ncm2-jedi/blob/485520af57aee528a3448d1f26bb7761dd915b0e/pythonx/ncm2_jedi.py#L27

Why should use $CONDA_PREFIX

To be honest, I can't find any exact document about $CONDA_PREFIX or $CONDA_PREFIX, but I found some related discussions. Anyway, I tested it myself. Luckily it works well.

Related issues:

roxma commented 5 years ago

Thanks