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.

Issue setting pythonpath in a remote (SSH) environment after setting a venv path

See original GitHub issue

Environment data

  • VS Code version: 1.47.3
  • Extension version (available under the Extensions sidebar): 2020.7.96456
  • OS and version: Mac OS 10.15.6 (local) and Ubuntu (server) 20.04
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: Jedi

Expected behaviour

Loading a python file (which activates the extension) and having my local python version in /bin/python3 used

Actual behaviour

Loading python interpreter fails silently

Steps to reproduce:

Tried out debugging for the first time locally, and it went great! decided to try out the new(ish) remote ssh extension to my ubuntu server. Working on a venv, I manually selected the python path (in my case ./bin/python3). Finishing that, I exited. Connecting again (via Remote-SSH - Connect to Host) I open the terminal, and open a python file in my home directory (using code pythonfile.py). I get the error “No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.” in the bottom right, and when I select /bin/python3, the “Select Python Interpreter” button is still yellow. Strangely, as a work around, I can open the home directory in a new window (code ~/) and I my python install is correctly identified automatically.

Logs

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

Starting Jedi Python language engine.
Error 2020-08-12 20:27:55: Diagnostic Code: InvalidPythonInterpreterDiagnostic, Message: No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.
Diagnostic Code: InvalidPythonInterpreterDiagnostic, Message: No Python interpreter is selected. You need to select a Python interpreter to enable features such as IntelliSense, linting, and debugging.

Linter 'pylint' is not installed. Please install it or select another linter".
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'file' cannot be empty. Received ''
> /usr/bin/python3 ~/.vscode-server/extensions/ms-python.python-2020.7.96456/pythonFiles/pyvsc-run-isolated.py pip --version
> conda info --json
> conda --version

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dpeetcommented, Apr 16, 2021

looks like it’s working now!

0reactions
karrtikrcommented, Apr 6, 2021

Is this issue still happening with the latest version of the extension?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Python environments in VS Code
To solve this problem, you could add the path to src to PYTHONPATH by creating an .env file within your VS Code workspace....
Read more >
Activating VirtualEnv in remote machine and update python path
I have ssh access and root access to the cloud machine. I am trying to execute bash scripts / python scripts from the...
Read more >
No way to activate virtualenv for remote interpreter : PY-29551
Hey @Pavel Karateev. Yes. Unless I am missing something, I can point a pycharm remote interpreter at the right python binary (in the...
Read more >
Setting up a Python development environment | Google Cloud
We recommend that you always use a per-project virtual environment when ... Set your shell to use the venv paths for Python by...
Read more >
Python Path and Version | Python in Visual Studio Code
Virtual Environments · Ensure none of the Python paths are configured in the settings.json file (leave them to their defaults). · Open your...
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