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

UndefinedVariable in interactive window #13018

Closed
stevenlis opened this issue Feb 10, 2023 · 15 comments · Fixed by #13019 or #13269
Closed

UndefinedVariable in interactive window #13018

stevenlis opened this issue Feb 10, 2023 · 15 comments · Fixed by #13019 or #13269
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@stevenlis
Copy link

Environment data

  • Language Server version: Pylance v2023.2.20
  • Jupyter extension: v2023.1.2010391206
  • OS and version: macos 13.2 (22D49)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.12
Version: 1.75.1
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
Date: 2023-02-08T21:34:01.965Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Darwin arm64 22.3.0
Sandboxed: No

Code Snippet

XXX

Repro Steps

CS-P8BCwjC9@2x

I have also tried with the pre-release of Jupyter extension
CS-TY4ywsJp@2x

Expected behavior

XXX

Actual behavior

XXX

Logs

log.txt

XXX

microsoft/pylance-release#3661

@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Feb 10, 2023
@debonte
Copy link
Contributor

debonte commented Feb 10, 2023

Thanks. I'm able to repro this now. Not sure why I wasn't able to before.

It's interesting that df is shown in the completion list, but still flagged as undefined.

@debonte debonte added the bug Issue identified by VS Code Team member as probable bug label Feb 10, 2023
@github-actions github-actions bot removed the triage-needed Issue needs to be triaged label Feb 10, 2023
@philnagel
Copy link

Also experiencing this issue, seeing it both on my M1 Mac and a Windows machine. Let me know if there's any info I can provide to help troubleshoot.

@rogerlga
Copy link

rogerlga commented Mar 5, 2023

Thanks for directing me to this issue. I'm also facing the same problem above, as I reported here: #6987 (comment).
My versions:

vscode: 1.76.0
Python extension: v2023.4.0
Pylance extension: v2023.3.10
Jupyter extension: v2023.2.1000592019

@debonte
Copy link
Contributor

debonte commented Mar 7, 2023

This is a bug in the Jupyter extension. I'll send a PR shortly.

@debonte debonte transferred this issue from microsoft/pylance-release Mar 7, 2023
@stevenlis
Copy link
Author

Hi, @debonte. Thanks for the fix. I've seen many updates of Jupyter extension. Will this be included in the next update soon?

@debonte
Copy link
Contributor

debonte commented Mar 20, 2023

@StevenLi-DS, the fix is currently available in Jupyter's prerelease builds. It should appear in their release builds in a couple weeks. I believe that, aside from hotfixes, new stable builds of Jupyter are typically released to the public on the first Thursday of each month.

You could watch the Python blog for the April release announcement, similar to this one from March: https://devblogs.microsoft.com/python/python-in-visual-studio-code-march-2023-release/

@stevenlis
Copy link
Author

@debonte I just realized that I've been using the prerelease builds for weeks. The problem still exists in v2023.3.1000830504 somehow.

@debonte
Copy link
Contributor

debonte commented Mar 23, 2023

I can't repro it with that version. Could you please set "python.trace.server": "verbose", repro it, and provide the resulting "Python Language Server" log?

Note that this setting is hidden, so you'll need to set it directly in the settings.json rather than via the Settings UI.

@stevenlis
Copy link
Author

@debonte I couldn't find the settings, but I did set "python.analysis.logLevel": "Trace"

jupyterlab: v2023.3.1000851011
pylance: v2023.3.30

vscode-log.log

CS-OiilzI3J@2x

@debonte
Copy link
Contributor

debonte commented Mar 25, 2023

I couldn't find the settings...

Ctrl+Shift+P to open the command palette. Then search for "Preferences: Open User Settings (JSON)". Execute that command and it will open your user settings.json. Add "python.trace.server": "verbose" in there.

We need to enable this to be able to see the LSP message traffic.

@stevenlis
Copy link
Author

stevenlis commented Mar 25, 2023

@debonte I think it's just hidden from the UI, but still in the json file... I see...

vscode-log.txt

@debonte
Copy link
Contributor

debonte commented Apr 4, 2023

@StevenLi-DS, thanks for the log. I'm able to repro this now and will investigate.

@debonte
Copy link
Contributor

debonte commented Apr 6, 2023

@StevenLi-DS, the second issue is now fixed. Please give it a try in the next Jupyter prerelease build.

@stevenlis
Copy link
Author

@debonte Is there any chance there could be an official release to fix this annoying issue rather than waiting antoher month since the pre-release is having issue:

Can't install pre-release version of 'ms-toolsai.jupyter' extension because it is not compatible with the current version of Visual Studio Code (version 1.77.2).

@debonte
Copy link
Contributor

debonte commented Apr 11, 2023

@StevenLi-DS, I believe that the pre-release Jupyter builds require VS Code Insiders.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
5 participants