Skip to content

Commit

Permalink
Merge pull request #21783 from mrclary/issue-21749
Browse files Browse the repository at this point in the history
PR: Always activate a conda environment for IPython consoles
  • Loading branch information
ccordoba12 authored Feb 9, 2024
2 parents cf49237 + c645a9e commit 75e5b60
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions spyder/plugins/ipythonconsole/utils/kernelspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import logging
import os
import os.path as osp
import sys

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


def is_different_interpreter(pyexec):
"""Check that pyexec is a different interpreter from sys.executable."""
executable_validation = osp.basename(pyexec).startswith('python')
directory_validation = osp.dirname(pyexec) != osp.dirname(sys.executable)
return directory_validation and executable_validation


def get_activation_script(quote=False):
"""
Return path for bash/batch conda activation script to run spyder-kernels.
Expand Down Expand Up @@ -92,11 +84,8 @@ def argv(self):
self.set_conf('default', True, section='main_interpreter')
self.set_conf('custom', False, section='main_interpreter')

# Part of spyder-ide/spyder#11819
is_different = is_different_interpreter(pyexec)

# Command used to start kernels
if is_different and is_conda_env(pyexec=pyexec):
if is_conda_env(pyexec=pyexec):
# If this is a conda environment we need to call an intermediate
# activation script to correctly activate the spyder-kernel

Expand Down

0 comments on commit 75e5b60

Please sign in to comment.