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

Module cannot be resolved from source but can actually be imported [Remote SSH] #1763

Closed
jingw222 opened this issue Sep 3, 2021 · 3 comments
Labels
waiting for user response Requires more information from user

Comments

@jingw222
Copy link

jingw222 commented Sep 3, 2021

Environment data

  • Language Server version: v2021.9.0
  • OS and version:
Version: 1.60.0
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:54:53.442Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0
  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.5

Expected behaviour

No warnings on import statements

Actual behaviour

Screen Shot 2021-09-03 at 11 50 37 PM

However these modules can be imported without an error. That being said, when I log onto the remote Linux desktop and run VSCode locally on that machine, the warnings do not exist.

@github-actions github-actions bot added the triage label Sep 3, 2021
@jakebailey
Copy link
Member

The notebook kernel isn't the interpreter that Pylance uses; can you try opening up a regular Python file, then ensuring that the interpreter that's selected at the bottom left is the same one that is selected for the notebook?

@jakebailey jakebailey added the waiting for user response Requires more information from user label Sep 3, 2021
@github-actions github-actions bot removed the triage label Sep 3, 2021
@jingw222
Copy link
Author

jingw222 commented Sep 4, 2021

Yes that solved the issue. Pylance not using the notebook kernel by default does not make sense to me. Why do I have to change it from another regular python script?

@jakebailey
Copy link
Member

The kernel and selected interpreter are separate; it used to be that both UIs were shown in notebooks, but that was changed at some point. I believe microsoft/vscode-jupyter#6333 is the issue that tracks ensuring Pylance is using the right interpreter (which will take a bit of work to fix), but I do wish that this mismatch were more visible while we work on trying to figure out a final solution.

I'm going to close this, as the linked issue is the place this is being tracked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for user response Requires more information from user
Projects
None yet
Development

No branches or pull requests

2 participants