question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote SSH Workspace cannot find Python Interpreter

See original GitHub issue

Environment data

  • VS Code version: 1.56.2
  • Extension version (available under the Extensions sidebar): Jupyter v2021.5.745244803, Python v2021.4.765268190 We had to downgrade because we couldn’t get anything to work with the newest version
  • OS and version: MacOS Catalina 10.15.7
  • Python version (& distribution if applicable, e.g. Anaconda): Local: Python 3.8.5 64-bit, Remote SSH: Python 3.7.3 64-bit
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): Conda in Remote SSH
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: Pylance v2021.4.2
  • Value of the python.languageServer setting: Pylance

[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]

We have already switched to pylance

Expected behaviour

Until May 13, 2021, when we use remote SSH on VS code, version v0.65.4, to connect to a workspace on our AWS GPU, can select the Python interpreter that is installed on the GPU. We have 2 Python 3.7.3 64 bit python interpreters available to us provided we remote SSH into a GPU workspace in VS code -

Screen Shot 2021-05-20 at 1 34 49 PM

Actual behaviour

As of May 13, 2021, the only python interpreters that I can select when I remote SSH into the GPU are the ones that are installed locally on my computer. These are obviously incorrect as they do not match Anaconda python versions installed on the GPU. We have even tried updating .vscode/settings.json value for python.pythonPath with the exact directory of the python interpreter location, but the remote SSH workspace can no longer see the correct python interpreters. When we try to select, this is what we see -

Screen Shot 2021-05-20 at 1 39 07 PM

As a result, we are not able to use any of the Jupyter features inside of the remote SSH workspace, such as the interactive window or the Jupyter notebook. When we attempt to use a Jupyter> command in VS code, we see that the extension is loading indefinitely.

Steps to reproduce:

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

Step 1 - remote ssh into GPU: Screen Shot 2021-05-20 at 1 47 45 PM

Step 2 - go to select python interpreter: Screen Shot 2021-05-20 at 1 48 00 PM

Step 3 - cannot see the correct python interpreters installed on GPU Screen Shot 2021-05-20 at 1 48 10 PM

Logs

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

User belongs to experiment group 'pythonaacf'
User belongs to experiment group 'pythonJediLSP'
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
User belongs to experiment group 'pythonTensorboardExperiment'
User belongs to experiment group 'pythonFindInterpretercf'
User belongs to experiment group 'PythonPyTorchProfiler'
User belongs to experiment group 'CollectLSRequestTiming - control'
User belongs to experiment group 'CollectNodeLSRequestTiming - experiment'
Error 2021-05-20 17:43:40: Failed to check if file needs to be fixed [EntryNotFound (FileSystemError): Unable to read file 'vscode-remote://ssh-remote+gpu/home/jmcdonald/.config/Code/User/settings.json' (Error: Unable to resolve non-existing file 'vscode-remote://ssh-remote+gpu/home/jmcdonald/.config/Code/User/settings.json')
	at _handleError (/home/jmcdonald/.vscode-server/bin/054a9295330880ed74ceaedda236253b4f39a335/out/vs/server/remoteExtensionHostProcess.js:87:156171)
	at async y.readText (/home/jmcdonald/.vscode-server/extensions/ms-python.python-2021.4.765268190/out/client/extension.js:9:339523)
	at async p.doesFileNeedToBeFixed (/home/jmcdonald/.vscode-server/extensions/ms-python.python-2021.4.765268190/out/client/extension.js:59:577126)
	at async /home/jmcdonald/.vscode-server/extensions/ms-python.python-2021.4.765268190/out/client/extension.js:59:576253
	at async Promise.all (index 0)
	at async p.getFilesToBeFixed (/home/jmcdonald/.vscode-server/extensions/ms-python.python-2021.4.765268190/out/client/extension.js:59:576199)
	at async p.updateTestSettings (/home/jmcdonald/.vscode-server/extensions/ms-python.python-2021.4.765268190/out/client/extension.js:59:575826)] {
  code: 'FileNotFound'
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
diliwang2ucommented, Jun 8, 2021

@kimadeline thanks again for all your help here. I have had pretty stable performance with vs code for the last 5 days. I also had other members of my team using the product and it is working for them as well. I think this can be closed. Thanks!

1reaction
diliwang2ucommented, Jun 3, 2021

@kimadeline,

Thank you for letting me know. The good news is that as of this evening, I am no longer having this issue. I am now able to select the correct interpreter and use the features of Jupyter as I had been using before. I did update to the latest version of the Python extension to be able to resolve the issue.

If you do not mind, would you be able to keep this ticket open until Friday, just to make sure that my current VS Code user experience is stable?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure an interpreter using SSH | PyCharm Documentation
Configuring remote Python interpreters via SSH · Click the Python Interpreter selector and choose Add New Interpreter. · Press Ctrl+Alt+S to open ...
Read more >
How to set default python interpreter in visual code on remote ...
Open the action bar (F1) and Search for "Python: Select interpreter". You can set it there. Share.
Read more >
Using Python environments in VS Code
To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). Python: Select Interpreter command. Note: ...
Read more >
Advanced Visual Studio Code for Python Developers
Remote Development With Containers; Remote Development With SSH; Remote ... If you're just getting started with VS Code, you might want to check...
Read more >
VSCode SSH setup ( and remote Python interpreter) - YouTube
Want improve your IT skills? Go to Pluralsight and get tutored by the best instructors!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found