Skip to content

Commit 75e5b60

Browse files
authored
Merge pull request #21783 from mrclary/issue-21749
PR: Always activate a conda environment for IPython consoles
2 parents cf49237 + c645a9e commit 75e5b60

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

spyder/plugins/ipythonconsole/utils/kernelspec.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import logging
1313
import os
1414
import os.path as osp
15-
import sys
1615

1716
# Third party imports
1817
from jupyter_client.kernelspec import KernelSpec
@@ -32,13 +31,6 @@
3231
logger = logging.getLogger(__name__)
3332

3433

35-
def is_different_interpreter(pyexec):
36-
"""Check that pyexec is a different interpreter from sys.executable."""
37-
executable_validation = osp.basename(pyexec).startswith('python')
38-
directory_validation = osp.dirname(pyexec) != osp.dirname(sys.executable)
39-
return directory_validation and executable_validation
40-
41-
4234
def get_activation_script(quote=False):
4335
"""
4436
Return path for bash/batch conda activation script to run spyder-kernels.
@@ -92,11 +84,8 @@ def argv(self):
9284
self.set_conf('default', True, section='main_interpreter')
9385
self.set_conf('custom', False, section='main_interpreter')
9486

95-
# Part of spyder-ide/spyder#11819
96-
is_different = is_different_interpreter(pyexec)
97-
9887
# Command used to start kernels
99-
if is_different and is_conda_env(pyexec=pyexec):
88+
if is_conda_env(pyexec=pyexec):
10089
# If this is a conda environment we need to call an intermediate
10190
# activation script to correctly activate the spyder-kernel
10291

0 commit comments

Comments
 (0)