You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS Code更新后Python调试PyQt5脚本异常问题求助

Fixing VS Code Debugger Issues for PyQt5 After Update

Hey Anthony, sorry to hear you're stuck with this debugger headache after updating VS Code—let's work through this step by step. The "Debug adapter process has terminated unexpectedly" error and your current PyQt5 debugging failure usually tie into compatibility gaps between the updated VS Code/Python extension, your older Python 3.4, and PyQt5. Here are actionable fixes to try:

  • Update (or Downgrade) the Python Extension
    VS Code updates often require matching updates to the Python extension, but newer extensions might drop support for older Python versions like 3.4.

    • First, open VS Code, head to the Extensions tab, find the Python extension by Microsoft, and check for updates. Install if available.
    • If updating doesn't help, try downgrading the extension to a version that supports Python 3.4. Right-click the Python extension, select "Install Another Version", and pick a release from around when your setup was working (e.g., v2021.x or earlier, since later versions phased out Python 3.4 support).
  • Reset Your Debug Configuration
    Corrupted launch.json settings are a common culprit. Let's fix that:

    1. Delete your existing .vscode/launch.json file (save a backup first if you want).
    2. Go to the Run and Debug tab, click "create a launch.json file", select "Python" > "Python File".
    3. Modify the auto-generated config to play nice with PyQt5—add the external terminal setting to avoid GUI-related conflicts:
    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Python: PyQt5 Script",
                "type": "python",
                "request": "launch",
                "program": "${file}",
                "console": "externalTerminal",
                "env": {
                    "PYTHONIOENCODING": "UTF-8",
                    "PYTHONUNBUFFERED": "1"
                }
            }
        ]
    }
    
  • Verify PyQt5 Compatibility with Python 3.4
    Newer PyQt5 versions no longer support Python 3.4. If you updated PyQt5 recently, it might be breaking things. Run this command in your terminal to install a compatible version:

    pip install pyqt5==5.11.3
    

    (5.11.3 is the last PyQt5 release that works with Python 3.4)

  • Test Script Execution Outside Debugger
    First, run your PyQt5 script directly in the terminal to rule out script/dependency issues:

    cd c:\Workspace\pyqt_tutorial
    set PYTHONIOENCODING=UTF-8
    set PYTHONUNBUFFERED=1
    C:\Python34\python.exe your_script_name.py
    

    If this runs without errors, the problem is definitely with VS Code's debugger setup. If it fails, focus on fixing your script or dependencies first.

  • Clear VS Code Cache
    Sometimes cached data causes weird, unexpected issues. Close VS Code completely, then delete these folders (backup if needed):

    • %APPDATA%\Code\Cache
    • %APPDATA%\Code\CachedData
      Reopen VS Code and try debugging again.

内容的提问来源于stack exchange,提问作者Anthony

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:11:28