We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm following the instructions as for https://code.visualstudio.com/docs/containers/debug-python
this used to work before upgrading docker to version 19.03.13
Python 3.7.6 Docker version 19.03.13, build 4484c46d9d
Create a project folder mkdir my-project && cd my-project
Create a minimal python file named app.py ` def main(): print('HELLO')
if name == "main": main() `
Create a python3 virtual environment. python3 -m venv py-venv
setting.json { "python.pythonPath": "py-venv/bin/python" }
tasks.json { "version": "2.0.0", "tasks": [ { "type": "docker-build", "label": "docker-build", "platform": "python", "dockerBuild": { "tag": "pydockerdebug:latest", "dockerfile": "${workspaceFolder}/Dockerfile", "context": "${workspaceFolder}", "pull": true } }, { "type": "docker-run", "label": "docker-run: debug", "dependsOn": [ "docker-build" ], "python": { "file": "app.py" } } ] }
launch.json { "configurations": [ { "name": "Docker: Python - General", "type": "docker", "request": "launch", "preLaunchTask": "docker-run: debug", "python": { "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "/app" } ], "projectType": "general" } } ] }
Create a Dockerfile ` FROM python:3.8-slim-buster ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1
WORKDIR /app ADD . /app
RUN useradd appuser && chown -R appuser /app USER appuser
CMD ["python", "app.py"] `
Run Debug
and the following error occurs
Couldn't spawn debuggee: [Errno 2] No such file or directory: '/Users/.../py_docker_debug/py-venv/bin/python'
Command line:['/Users/.../py_docker_debug/py-venv/bin/python', '/debugpy', '--connect', 'host.docker.internal:52703', '--configure-qt', 'auto', '--adapter-access-token', '875b8dec0efaabdcdfad7028575706dbb916c2d8bde6e3fd8c25da2142db2a8a', 'app.py']
The text was updated successfully, but these errors were encountered:
It looks like it'll require some changes on vscode-docker side to fix. I'll follow up in the original repo.
Sorry, something went wrong.
on vscode-docker side to fix. I'll follow up in the original repo.
Thanks @int19h
This will be a dupe of #463
No branches or pull requests
I'm following the instructions as for https://code.visualstudio.com/docs/containers/debug-python
this used to work before upgrading docker to version 19.03.13
Python 3.7.6
Docker version 19.03.13, build 4484c46d9d
Create a project folder
mkdir my-project && cd my-project
Create a minimal python file named app.py
`
def main():
print('HELLO')
if name == "main":
main()
`
Create a python3 virtual environment.
python3 -m venv py-venv
setting.json
{ "python.pythonPath": "py-venv/bin/python" }
tasks.json
{ "version": "2.0.0", "tasks": [ { "type": "docker-build", "label": "docker-build", "platform": "python", "dockerBuild": { "tag": "pydockerdebug:latest", "dockerfile": "${workspaceFolder}/Dockerfile", "context": "${workspaceFolder}", "pull": true } }, { "type": "docker-run", "label": "docker-run: debug", "dependsOn": [ "docker-build" ], "python": { "file": "app.py" } } ] }
launch.json
{ "configurations": [ { "name": "Docker: Python - General", "type": "docker", "request": "launch", "preLaunchTask": "docker-run: debug", "python": { "pathMappings": [ { "localRoot": "${workspaceFolder}", "remoteRoot": "/app" } ], "projectType": "general" } } ] }
Create a Dockerfile
`
FROM python:3.8-slim-buster
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
ADD . /app
RUN useradd appuser && chown -R appuser /app
USER appuser
CMD ["python", "app.py"]
`
Run Debug
and the following error occurs
Couldn't spawn debuggee: [Errno 2] No such file or directory: '/Users/.../py_docker_debug/py-venv/bin/python'
Command line:['/Users/.../py_docker_debug/py-venv/bin/python', '/debugpy', '--connect', 'host.docker.internal:52703', '--configure-qt', 'auto', '--adapter-access-token', '875b8dec0efaabdcdfad7028575706dbb916c2d8bde6e3fd8c25da2142db2a8a', 'app.py']
The text was updated successfully, but these errors were encountered: