-
Notifications
You must be signed in to change notification settings - Fork 764
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
Using Pylance on Remote Machine #6159
Comments
Thanks for the issue. What's your version of node on the remote machine? |
Ahh, okay. I couldn't find that dropdown in the UI, but the system administrators I was working with had me point it to |
If you restart does it work? That error might have been because you set the node executable but didn't restart VS code (the Python extension was attempting to shutdown the old version maybe). |
Good point. I've both restarted VS Code and reconnected to the remote several times. |
Might be something about node on your remote machine then. You can try the command we run internally yourself to see if it gives you any extra output. it should be something like:
Sometimes global node environment variables can make running node by itself not work for us. Alternatively we could try and figure out why using the VS code node crashed/ran out of memory. |
Okay! I got this output after running that command:
I would also be down to learn why VS Code's node ran out of memory. |
That output is actually expected, it's what happens when Pylance runs without VS code, but that means it didn't crash which is good/bad (bad in that we don't have an easy way to figure out why VS code is crashing pylance). Can you share your source? That would be the easiest way to figure out the memory problem. We can reproduce it in house and analyze all the data. You can e-mail the source too if you don't want to share it publicly. My e-mail is my github id at microsoft.com. If you can't share the source, you might try some other techiques listed at the help for the Like:
We'd rather just make our software use less memory though if we can reproduce the issue. |
Hello! I think I can, what does sharing the source mean? |
The easiest way is if your source code is in a public github repository. Then we just git clone your source and try to reproduce the issue. Otherwise you'd likely need to send or upload a zip file of the source. |
Ah, I see! The problem persists regardless of what repo I'm working in remotely. |
So any python code will cause pylance to crash? |
Can you get logs for pylance and upload them according to the directions here? https://github.com/microsoft/pylance-release/blob/main/TROUBLESHOOTING.md#filing-an-issue |
I may have made an incorrect assumption, that you were running out of memory. Something else might be causing a crash. |
Okay! Here's what I've seen this morning:
Interestingly, since it crashed and restarted, it hasn't crashed again but it also hasn't been able to perform any Python Language features (e.g., identify variables, go to variable references, etc.) Thanks! |
I solved this issue by upating node to the latest available version and by changing the following setting: python.analysis.nodeExecutable = "/home/your_user/.nvm/versions/node/v20.16.0/bin/node" I hope this will help... |
@AnsonSavage that is an out of memory problem. So my original assumption was correct. We'd need access to the source code you're using in order to reproduce the issue. The directory with all of your python code in it. You might also try what @zuliani99 suggested and upgrade your node executable. |
Okay. I'm logged in to a remote node that has many subfolders and many repositories. From the workspace root, there are 282260 Python files. (I'm assuming that this is what is causing Pylance to crash.) However, it is helpful to use VSCode and log in such that I can see all the folders on our entire system. Is it possible to tell Pylance that I want to limit its processing to a directory and its subdirectories so that it's only processing and managing the Python for the particular code that I'm working on? |
Yes actually there's a description of how to do that here: You can exclude everything you're not currently working on using the They're also described in more detail here: |
You would need to do that in the root though, not in that folder. Pylance is analyzing the entire workspace so it would still include everything else. or you could just open that folder directly and setup your 'extraPaths' in the .vscode/settings.json to include the folder(s) you need to load imports. |
Ah, I see! Okay, I'll give that a try. Thank you! |
Awesome, that looks like it worked!! Thank you so much! |
THanks, glad it worked. |
Similar to this issue: #5245
While using SSH to work remotely in VS Code, I got this error:
I resolved this error by setting the path to Node explicitly here:
However, now I get these kinds of errors:
The corresponding output is:
Environment data
Logs
I've enabled logging, but I don't see any output. When I do something like press F12 on a Python variable, I just see the blue loading bar with no output.
Thanks!
Anson
The text was updated successfully, but these errors were encountered: