简体   繁体   中英

VsCode Remote Debugging, change pythonpath to point to docker container's python interpreter

I currently have a tensorflow-gpu docker container fully built. I have a volume from my host's workspace ( $PWD ) to /workspace inside the docker container.

I can successfully remote debug the python scripts inside my workspace/docker's workspace folder, but as expected, my pylint and intellisense don't work inside vscode, as the pythonPath is set to my local python interpreter, and the pylint init-hooks are using my local python environment to figure out if it should squiggly line something.

How do I change my local vscode's pythonpath to point to the python interpreter on docker rather than on the host? I want pylint to be calibrated to the docker's environment rather than the local host's environment.

What you want is remote interpreter support which isn't supported yet. Please subscribe to this issue to know the status of this feature.

I followed up on Brett's answer and you can now do the following:

  1. Install the remote-containers extension.
  2. Click "shift+command(ctrl)+p" and type and select "remote-containers: open folder in remote docket container"

I hope this helps. More information is available here:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM