Reputation: 3613
The setup I work with has a docker container with Python and all relevant dependencies installed in it. The codebase itself (decoupled from the environment) is on the local machine, and gets mounted to the docker container when changes occur.
However, all Python highlighting and code completion, also in regard to the installed dependencies (mainly Django in this case) do not work in VSCODE since python.Path
has no access to any interpreter.
I would prefer to avoid setting up a doubled venv on the local machine if possible. Is there a way to just connect VSCODE to the python environment available in the docker container?
Upvotes: 0
Views: 435
Reputation: 10102
when using vscode, you can develop inside a container
Workspace files are mounted from the local file system or copied or cloned into the container. Extensions are installed and run inside the container, where they have full access to the tools, platform, and file system. This means that you can seamlessly switch your entire development environment just by connecting to a different container.
This lets VS Code provide a local-quality development experience — including full IntelliSense (completions), code navigation, and debugging — regardless of where your tools (or code) are located.
Upvotes: 1