From 14e121e84eb00708ef5a800d075912b2aa3fedc2 Mon Sep 17 00:00:00 2001 From: Daniel Zhang Date: Tue, 26 Dec 2017 11:54:14 +0800 Subject: [PATCH] Detect python2 in anaconda, for jedi source BTW, I think there should be a option for specifying python2/3, someone (like me) may have python3 installed but coding with python2. --- pythonx/cm_sources/cm_jedi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pythonx/cm_sources/cm_jedi.py b/pythonx/cm_sources/cm_jedi.py index d130ffe..6076d3c 100644 --- a/pythonx/cm_sources/cm_jedi.py +++ b/pythonx/cm_sources/cm_jedi.py @@ -13,6 +13,10 @@ py2 = os.path.join(os.environ['VIRTUAL_ENV'], 'bin', 'python2') if os.path.isfile(py2): py = 'python2' +if 'CONDA_PREFIX' in os.environ: + py2 = os.path.join(os.environ['CONDA_PREFIX'], 'bin', 'python2') + if os.path.isfile(py2): + py = 'python2' from cm import register_source, getLogger, Base register_source(name='cm-jedi',