spyder-ide/spyder-notebook

Unable show environment name correctly on spyder notebook

Opened this issue · 2 comments

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

I installed Spyder and spyder-notebook in Conda base env on my Linux device, and access other python environments with spyder-kernel. The editor is running smoothly. But for Spyder Notebook, it unable to show environment name correctly. And I have to blind test each env till correct one. Here is the screenshot for select the python environment, as you can see, all env show "Python3 (Spyder)".

截圖 2024-10-15 17 55 11

I am sure that I set ipykernel correctly. Because it shows normally on jupyrt lab and jupyter notebook as following screenshot.

截圖 2024-10-15 17 56 23

截圖 2024-10-15 18 32 46

What steps reproduce the problem?

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version: 5.5.1
  • Python version: Python 3.12.2
  • Qt version: 5.15.2
  • PyQt version: PyQt5 5.15.10
  • Operating System name/version: ubuntu 22.04

Dependencies

PASTE DEPENDENCIES HERE

Hi @hawkiyc thank you for the report! I'm not totally sure what could be happening but what do you think @jitseniesen ? Maybe some sort of extension is missing over spyder-notebook? Or maybe spyder-kernels should setup something to be able to properly show the kernel env name? 🤔

Sorry, I missed this report when it was originally submitted. I need to dive into the code to figure out what exactly is happening. If I remember correctly, then the name of the kernel is set to "Python 3 (Spyder)", so we do need to change this so that it also shows the environment. I think that when you start the notebook, it will use the kernel from the environment that is specified in the Spyder preferences (or maybe the environment that was specified when the notebook server was started). I believe that we never considered the possibility of changing the kernel after the notebook was started.

I am transferring this issue to the spyder-notebook repository and I will try to find some time to have a proper look so that we can decide how to improve.