Python (Remote + Vscode)

R3zk0n Β· October 2, 2025

Contents

    Remote Debugging for Python

    1. Install Visual Studio Code. + https://code.visualstudio.com/docs/?dv=linux64_deb + sudo apt install ~/Downloads/code_1.45.1-1589445302_amd64.deb + Install β€œPython” extension + Python debugging for VSCode: pip install ptvsd

    2. Configure application to debug. Example Frappe: + cat /home/frappe/frappe-bench/Procfile + #web: bench serve --port 8000 –> Uncomment to manually start web server + Edit the main app file with debugging port: /home/frappe/frappe-bench/apps/frappe/frappe/app.py python import ptvsd # By default, remote debugging starts on port 5678 ptvsd.enable_attach(redirect_output=True) print("Now ready for the IDE to connect to the debugger") ptvsd.wait_for_attach()

    3. Load the code into Visual Studio Code. + Use Rsync via SSH: rsync -azP frappe@192.168.121.123:/home/frappe/frappe-bench ./

    4. Configure Visual Studio Code to connect to the remote debugger. + Start all services: bench start + Start web server + debugging port: ../env/bin/python ../apps/frappe/frappe/utils/bench_helper.py frappe serve --port 8000 --noreload --nothreading + Create launch.json from VSCode

      • Debugging configuration –> Remote Attach –> IP:5678
      • Update Host and Remote root values to sync

    Twitter, Facebook