linuxvisual-studio-codepython-venvsshfs

VSCode remote Python virtual environment


Here is how the thing doesn't work:

The project source code is located on a remote machine. The Python virtual environment is installed in the project's root directory (using venv).

I sshfs the project folder and start local VSCode. It detects the virtual environment, but doesn't see pylint or other packages installed in it.

Python 3.6.7 VS Code - latest version OSs - Debian 9 remote, Linux Mint 19 local Both sshfs connection and venv installation are performed under the same account.

Is there some special way a virtual environment should be set up to be usable remotely?


Solution

  • There were problems with sshfs in early VSCode versions, but recent distrib has Remote Development extension that lets you develop your code via ssh.

    Since you have activated your virtual environment, just get venv python path with which python command and copy it to the Select Interpreter menu.