Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outline shows duplicated "Jupyter" and "Python" entries #3104

Closed
joel-kelly opened this issue Jul 27, 2022 · 3 comments
Closed

Outline shows duplicated "Jupyter" and "Python" entries #3104

joel-kelly opened this issue Jul 27, 2022 · 3 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@joel-kelly
Copy link

The outline view in VSCode has recently started doing something mildly annoying where the outline entries are listed twice when I am editing a .py file, if I have a Jupyter notebook open at the same time.

I submitted this as a bug to the VSCode repo but they told me to bring it here.

Environment data

  • VS Code version: 1.69.2
  • Jupyter Extension version (available under the Extensions sidebar): v2022.6.1201981810
  • Python Extension version (available under the Extensions sidebar): v2022.10.1
  • OS (Windows | Mac | Linux distro) and version: Windows_NT x64 10.0.19043
  • Python and/or Anaconda version: Python 3.9.7
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Local

Expected behaviour

The outline view should only display one set of entries.

Actual behaviour

Two entries are displayed, see screenshot.
2. open notebook, now outline for .py file is duplicated

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Open a .py file. Outline in the Explorer looks normal (displays classes, functions, etc).
    1. open py file, outline looks normal

  2. Open a .ipynb notebook file. Outline displays Jupyter markdown cells, looks normal.

  3. Switch back to the .py file. Outline now has "Jupyter" and "Python" headers for this .py file, which contains duplicated entries (same entries as in step 1: classes, functions, etc).
    2. open notebook, now outline for .py file is duplicated

Logs

Output for Jupyter in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Jupyter)

Visual Studio Code (1.69.2, undefined, desktop)
Jupyter Extension Version: 2022.6.1201981810.
Python Extension Version: 2022.10.1.
No workspace folder opened.
info 12:46:4.907: ZMQ install verified.
User belongs to experiment group 'jupyterTest'
User belongs to experiment group 'jupyterEnhancedDataViewer'
info 12:46:5.350: LSP Notebooks experiment is disabled -- not in treatment group
info 12:46:5.575: Experiment status for python is {"enabled":true,"optInto":[],"optOutFrom":[]}
info 12:46:6.155: Process Execution: > c:\Program Files (x86)\Python310-32\python.exe -m pip list

c:\Program Files (x86)\Python310-32\python.exe -m pip list
info 12:46:18.257: Preferred Remote kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb is undefined
info 12:46:18.275: Preferred Remote kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb is undefined
info 12:46:18.275: Find preferred kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.7 ('acid')","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.7"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138"}}} & preferred interpreter c:\Program Files (x86)\Python310-32\python.exe
info 12:46:18.278: Preferred Remote kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb is undefined
info 12:46:18.278: Preferred kernel .jvsc74a57bd0986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138.c:\ProgramData\miniforge3\envs\acid\python.exe.c:\ProgramData\miniforge3\envs\acid\python.exe.-m#ipykernel_launcher is exact match
info 12:46:18.278: PreferredConnection: .jvsc74a57bd0986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138.c:\ProgramData\miniforge3\envs\acid\python.exe.c:\ProgramData\miniforge3\envs\acid\python.exe.-m#ipykernel_launcher found for NotebookDocument: f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb
info 12:46:18.314: Preferred Remote kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb is undefined
info 12:46:18.314: Find preferred kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb with metadata {"kernelspec":{"display_name":"Python 3.9.7 ('acid')","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.9.7"},"orig_nbformat":4,"vscode":{"interpreter":{"hash":"986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138"}}} & preferred interpreter c:\Program Files (x86)\Python310-32\python.exe
info 12:46:18.317: Preferred Remote kernel for f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb is undefined
info 12:46:18.317: Preferred kernel .jvsc74a57bd0986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138.c:\ProgramData\miniforge3\envs\acid\python.exe.c:\ProgramData\miniforge3\envs\acid\python.exe.-m#ipykernel_launcher is exact match
info 12:46:18.776: Registering dummy command feature
info 12:46:18.818: Starting Jupyter Session id = 'startUsingPythonInterpreter:.jvsc74a57bd0986d8e3c41ce8164780d90ff3d0b15bc8797f31c4543868abad1dfa1775e5138.c:\ProgramData\miniforge3\envs\acid\python.exe.c:\ProgramData\miniforge3\envs\acid\python.exe.-m#ipykernel_launcher' (Python Path: c:\ProgramData\miniforge3\envs\acid, EnvType: Conda, EnvName: 'acid', Version: 3.9.7) for 'f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb' (disableUI=true)
info 12:46:18.818: Creating raw notebook for resource 'f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb'
info 12:46:18.818: Computing working directory for resource 'f:\temp\Joel K temp\Python stuff\dummy notebook.ipynb'
info 12:46:18.857: Starting raw kernel 'acid (Python 3.9.7)' for interpreter c:\ProgramData\miniforge3\envs\acid\python.exe
info 12:46:18.913: Kernel launching with ports 9000,9001,9002,9003,9004. Start port is 9000
info 12:46:19.809: Registering dummy command feature
info 12:46:23.286: Process Execution: > c:\ProgramData\miniforge3\envs\acid\python.exe -m pip list
c:\ProgramData\miniforge3\envs\acid\python.exe -m pip list
info 12:46:23.289: Process Execution: > c:\ProgramData\miniforge3\envs\acid\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)"
c:\ProgramData\miniforge3\envs\acid\python.exe -c "import ipykernel; print(ipykernel.version); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.file)"
info 12:46:23.295: Creating daemon process for c:\ProgramData\miniforge3\envs\acid\python.exe with env variables count 64
info 12:46:23.298: Process Execution: > c:\ProgramData\miniforge3\envs\acid\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 11096
c:\ProgramData\miniforge3\envs\acid\python.exe -m vscode_datascience_helpers.daemon --daemon-module=vscode_datascience_helpers.kernel_interrupt_daemon -v --ppid 11096
info 12:46:23.562: get interrupthandle daemon
info 12:46:23.566: Process Execution: > c:\ProgramData\miniforge3\envs\acid\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"b9b7b7a6-4cbc-4d5b-b66a-8a6f994ccb61" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\joelk\AppData\Roaming\jupyter\runtime\kernel-v2-11096cjuNidOe9sfd.json
c:\ProgramData\miniforge3\envs\acid\python.exe -m ipykernel_launcher --ip=127.0.0.1 --stdin=9003 --control=9001 --hb=9000 --Session.signature_scheme="hmac-sha256" --Session.key=b"b9b7b7a6-4cbc-4d5b-b66a-8a6f994ccb61" --shell=9002 --transport="tcp" --iopub=9004 --f=c:\Users\joelk\AppData\Roaming\jupyter\runtime\kernel-v2-11096cjuNidOe9sfd.json
info 12:46:23.566: Process Execution: cwd: f:\temp\Joel K temp\Python stuff
cwd: f:\temp\Joel K temp\Python stuff
info 12:46:23.810: ipykernel version 6.5.0 for c:\ProgramData\miniforge3\envs\acid\python.exe
info 12:46:23.810: ipykernel location c:\ProgramData\miniforge3\envs\acid\lib\site-packages\ipykernel_init_.py for c:\ProgramData\miniforge3\envs\acid\python.exe
warn 12:46:24.979: StdErr from Kernel Process c:\ProgramData\miniforge3\envs\acid\lib\site-packages\traitlets\traitlets.py:2202: FutureWarning: Supporting extra quotes around strings is deprecated in traitlets 5.0. You can use 'hmac-sha256' instead of '"hmac-sha256"' if you require traitlets >=5.
warn(
c:\ProgramData\miniforge3\envs\acid\lib\site-packages\traitlets\traitlets.py:2157: FutureWarning: Supporting extra quotes around Bytes is deprecated in traitlets 5.0. Use 'b9b7b7a6-4cbc-4d5b-b66a-8a6f994ccb61' instead of 'b"b9b7b7a6-4cbc-4d5b-b66a-8a6f994ccb61"'.
warn(

info 12:46:25.56: Kernel Output: NOTE: When using the ipython kernel entry point, Ctrl-C will not work.

To exit, you will have to explicitly quit this process, by either sending
"quit" from a client, or using Ctrl-\ in UNIX-like environments.

To read more about this, see ipython/ipython#2049

To connect another client to this kernel, use:
--existing c:\Users\joelk\AppData\Roaming\jupyter\runtime\kernel-v2-11096cjuNidOe9sfd.json

info 12:46:25.99: Started kernel acid (Python 3.9.7)., (Raw session started and connected)
info 12:46:25.100: Finished connecting 4073ffc0-c1df-4c0b-984b-49ab60b02cab
info 12:46:25.102: UpdateWorkingDirectoryAndPath in Kernel
info 12:46:25.102: Executing silently Code (idle) = import os\nimport sys\n%cd "f:\temp\Joel K temp\Python stuff"\nif os.getcwd() not in sys.path:\nsys.
info 12:46:25.131: Executing silently Code (completed) = import os\nimport sys\n%cd "f:\temp\Joel K temp\Python stuff"\nif os.getcwd() not in sys.path:\nsys. with 1 output(s)
info 12:46:25.131: Waiting for idle on (kernel): 18a2e493-1728-4626-b494-fe0fb5f8daad -> idle
info 12:46:25.131: Finished waiting for idle on (kernel): 18a2e493-1728-4626-b494-fe0fb5f8daad -> idle
info 12:46:25.143: Widget Message: Received IPyWidgets_kernelOptions in ScriptManager
info 12:46:25.143: Widget Message: Received IPyWidgetMessages.IPyWidgets_kernelOptions
error 12:46:25.171: Failed to get baseUrl [Error: ENOENT: no such file or directory, lstat 'c:\ProgramData\miniforge3\envs\acid\share\jupyter\nbextensions'] {
errno: -4058,
code: 'ENOENT',
syscall: 'lstat',
path: 'c:\ProgramData\miniforge3\envs\acid\share\jupyter\nbextensions'
}

@joel-kelly joel-kelly added the bug Something isn't working label Jul 27, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jul 27, 2022

We don't actually provide the outline entries. Pylance does that as far as I know. Transferring there.

@rchiodo rchiodo transferred this issue from microsoft/vscode-jupyter Jul 27, 2022
@rchiodo rchiodo removed their assignment Jul 27, 2022
@heejaechang
Copy link
Contributor

dup of #3027

@heejaechang heejaechang added the duplicate This issue or pull request already exists label Jul 28, 2022
@bschnurr
Copy link
Member

I see "no folder selected" does it happen if you use "Open Folder" ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants