Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions src/sage/repl/ipython_kernel/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,23 @@ def check(cls):
try:
spec = get_kernel_spec(ident)
except NoSuchKernel:
warnings.warn(f'no kernel named {ident} is accessible; '
warnings.warn(f'No kernel named {ident} is accessible; '
'check your Jupyter configuration '
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html)')
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html).')
else:
import sys
import shutil
from pathlib import Path
if Path(spec.argv[0]).resolve() != Path(os.path.join(SAGE_VENV, 'bin', 'sage')).resolve():
warnings.warn(f'the kernel named {ident} does not seem to correspond to this '
kernel_executable = shutil.which(spec.argv[0])
if not kernel_executable:
warnings.warn(f'The kernel named {ident} does not seem to be runnable; '
'check your Jupyter configuration '
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html).')
return
if Path(kernel_executable).resolve() != Path(sys.executable).resolve():
warnings.warn(f'The kernel named {ident} does not seem to correspond to this '
'installation of SageMath; check your Jupyter configuration '
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html)')
'(see https://docs.jupyter.org/en/latest/use/jupyter-directories.html).')


def have_prerequisites(debug=True) -> bool:
Expand Down
Loading