top | item 30918368

(no title)

antholeole | 3 years ago

Hijacking this: does anyone know how to get vscode to use a python interpreter inside a docker container for linting? I’ve resorted to using the docker container, but also having a python env so that I can tell vscode to point to the python interpreter in the env to get linting. Otherwise, dependencies come up unresolved.

I did some googling, but I’m unfortunately not experienced enough to be able to describe the problem succinctly to google.

Using pylance, btw.

TIA!

discuss

order

nevalsar|3 years ago

Try this: 1. Bring up command palette using `Ctrl+Shift+p` 2. Search and select "Python: Select Interpreter" 3. Select your Python environment.

This works in VSCode over SSH perfectly fine - the locally running VSCode is able to detect and select Python environments in the remote server.

antholeole|3 years ago

The trouble with this is that the python environment is in the container - In step 2, id need to type path to the interpreter that it inside the container.

Although, now you’ve got me thinking what would happen if I mounted the interpreter inside the container to something local that I can point to? Might try this later, thanks for the help!