{"id":5019,"library":"pydevd","title":"PyDev.Debugger","description":"PyDev.Debugger is a powerful Python debugger primarily known for its integration with IDEs such as PyDev (Eclipse), PyCharm, and VSCode Python (via debugpy). It allows for seamless remote debugging of Python applications running in various environments. The library is actively maintained, with regular updates to support new Python versions and enhance performance, including fast tracing with `sys.monitoring` for Python 3.12+. The current stable version is 3.5.0.","status":"active","version":"3.5.0","language":"en","source_language":"en","source_url":"https://github.com/fabioz/PyDev.Debugger/","tags":["debugger","remote debugging","IDE integration","pydev","pycharm","vscode"],"install":[{"cmd":"pip install pydevd","lang":"bash","label":"Install pydevd for remote debugging"}],"dependencies":[],"imports":[{"note":"While `pydevd_pycharm` exists for PyCharm specific integrations, `pydevd.settrace` is the standard for general remote debugging with `pydevd`.","wrong":"import pydevd_pycharm.settrace() for generic remote debugging","symbol":"settrace","correct":"import pydevd\npydevd.settrace(host='<IDE_HOST>', port=<IDE_PORT>)"}],"quickstart":{"code":"import pydevd\nimport os\n\n# Configure host and port for your IDE's debug server\n# The host should be the IP address or hostname where your IDE is running.\n# The port should match the port configured in your IDE's debug server.\n# For local debugging, 'localhost' or '127.0.0.1' is common.\n# Ensure these environment variables are set in your execution environment\n# or replace with literal values for quick testing.\n\nIDE_HOST = os.environ.get('PYDEVD_REMOTE_HOST', '127.0.0.1')\nIDE_PORT = int(os.environ.get('PYDEVD_REMOTE_PORT', '5678')) # Common default port\n\nprint(f\"Connecting PyDev.Debugger to {IDE_HOST}:{IDE_PORT}...\")\n\ntry:\n    # This line connects the Python process to the remote debugger server.\n    # Execution will pause here until the IDE connects.\n    pydevd.settrace(host=IDE_HOST, port=IDE_PORT, suspend=False, stdoutToServer=True, stderrToServer=True)\n    print(\"Debugger connected. You can now set breakpoints in your IDE.\")\nexcept Exception as e:\n    print(f\"Could not connect to debugger: {e}\")\n\ndef main():\n    message = \"Hello, remote debugging!\"\n    print(message)\n    # Place a breakpoint here in your IDE after connecting\n    result = \"Debugging complete.\"\n    print(result)\n\nif __name__ == '__main__':\n    main()\n","lang":"python","description":"This quickstart demonstrates how to initiate remote debugging. Run this script, then start your IDE's remote debug server (e.g., 'Python Debug Server' in PyCharm or 'Attach' configuration in VSCode with PyDev for VSCode extension). The script will pause at `settrace` (if `suspend=True`) or continue until a breakpoint is hit. Ensure `PYDEVD_REMOTE_HOST` and `PYDEVD_REMOTE_PORT` environment variables match your IDE's debug server configuration."},"warnings":[{"fix":"Ensure the installed `pydevd` version matches your Python interpreter's compatibility requirements. Check the official documentation or PyPI for the correct version mapping.","message":"PyDev.Debugger versions are often tied to specific Python versions. Latest 3.x versions (e.g., 3.5.0) require Python 3.8 and onwards. For Python 3.3 to 3.7, use `pydevd==2.10.0`. For Python 2, use `pydevd==2.8.0`. Installing an incompatible version can lead to runtime errors.","severity":"breaking","affected_versions":"< 3.8.0 for Python 3.3-3.7; all 3.x for Python 2"},{"fix":"Only `pip install pydevd` for explicit remote debugging setups. For IDE-managed debugging, rely on the IDE's built-in debugger or follow its specific instructions for remote debugging (e.g., `pydevd-pycharm` for PyCharm).","message":"It is generally not recommended to install `pydevd` separately if you are using an IDE (like PyDev for Eclipse, PyCharm, or VSCode Python with `debugpy`) that already bundles or manages its debugger backend. Manual installation is primarily for remote debugging scenarios where the target machine does not have the IDE's bundled helper files, and can lead to version conflicts or unexpected behavior if mismatched with the IDE's internal debugger version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the latest `pydevd` documentation or IDE-specific instructions for the most current `settrace` parameter names and usage. Update your `settrace` calls accordingly.","message":"Some parameters to `pydevd.settrace()` (or `pydevd_pycharm.settrace()`) like `stdoutToServer` or `stderrToServer` have undergone renaming in newer versions to be more 'Pythonic'. Using older parameter names with a newer `pydevd` version can result in errors.","severity":"deprecated","affected_versions":"Potentially 3.x, exact versions vary."},{"fix":"For VSCode/Visual Studio, rely on the `debugpy` extension to provide the debugger. If remote debugging requires a standalone `pydevd`, ensure its version is compatible with the `debugpy` version you are using, or consider alternative remote debugging configurations provided by your IDE.","message":"The standalone `pydevd` library (fabioz/PyDev.Debugger) and the `pydevd` version vendored within Microsoft's `debugpy` (used by VSCode Python and Visual Studio Python) have diverged significantly since `debugpy` version 1.8.1. This means that installing a recent standalone `pydevd` might not be compatible with `debugpy`'s expectations, potentially breaking debugging functionality for VSCode/Visual Studio users.","severity":"breaking","affected_versions":"debugpy 1.8.1 and newer when using standalone pydevd"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}