Visual Studio Code debugs python 2.7 app in a docker container with python3 #3585
-
Hi there, I am having some trouble getting my debugger to work in VS Code and from the error messages below, I gather that there is a discrepancy between the python versions. The legacy app I am working on is using Python 2.7. I have come across this similar issue: Issue reference , however still can't get it to work. Is there anything obvious that I'm missing? Any assistance will be greatly appreciated.
Pop up Error 1: Terminal error: My configurations are:launch.json tasks.json: settings.py
} manage.py if name == "main":
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
It looks like after one of your edits the terminal error message isn't there, can you share it? |
Beta Was this translation helpful? Give feedback.
-
debugpy is no longer compatible with anything earlier than Python 3.7. However, earlier versions of debugpy were compatible with Python 2.7, and can still be used for "attach" / |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the feedback - really appreciate it! We managed to get it to work using ptvsd with the following configurations: manage.py
launch.json docker-compose.yml |
Beta Was this translation helpful? Give feedback.
Thank you so much for the feedback - really appreciate it! We managed to get it to work using ptvsd with the following configurations:
manage.py
from django.conf import settings
launch.json
{
"name": "Django",
"type": "python",
"request": "attach",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
],
"port": 3000,
"host": "localhost"
}
docker-compose.yml
ports:
- "8000:8000"
-…