vscode/trae 的 Python Environments 的插件为什么频繁崩溃啊?附带解决方案

0 阅读2分钟

vscode/trae 的 Python Environments 的插件为什么频繁崩溃啊?附带解决方案

问题描述

preview

Python Environment Tools (PET) failed after 3 restart attempts. Please reload the window or check the output channel for details. To debug, run "Python Environments: Run Python Environment Tool (PET) in Terminal" from the Command Palette.

https://image-static.segmentfault.com/271/620/2716203714-69a28f99ee184_fix732

2026-02-28T13:57:16.665+08:00 [info] Conda not found, turning off conda features. [Error: Request 'configure' timed out after 30000ms
	at Timeout.<anonymous> (/Users/ponponon/.trae/extensions/ms-python.vscode-python-envs-1.20.1-universal/dist/extension.js:2:534062)
	at listOnTimeout (node:internal/timers:588:17)
	at process.processTimers (node:internal/timers:523:7)]
2026-02-28T13:57:20.672+08:00 [info] [pet] Starting Python Locator /Users/ponponon/.trae/extensions/ms-python.python-2026.2.0-universal/python-env-tools/bin/pet server
2026-02-28T13:57:20.672+08:00 [info] [pet] Python Environment Tools restarted successfully
2026-02-28T13:57:20.674+08:00 [info] [pet] configure: Sending configuration update: {"workspaceDirectories":["/Users/ponponon/Desktop/code/me/github/nanobot"],"environmentDirectories":["/Users/ponponon/Desktop/code/me/github/nanobot/**/.venv"],"pipenvExecutable":"pipenv","poetryExecutable":"poetry","cacheDirectory":"/Users/ponponon/Library/Application Support/Trae/User/globalStorage/ms-python.vscode-python-envs/pythonLocator"}
2026-02-28T13:57:20.674+08:00 [error] [pet] Process error: 发生了系统错误 (spawn /Users/ponponon/.trae/extensions/ms-python.python-2026.2.0-universal/python-env-tools/bin/pet ENOENT)
2026-02-28T13:57:50.674+08:00 [warning] [pet] Configure request timed out, killing hung process for restart
2026-02-28T13:57:50.675+08:00 [error] [pet] configure: Configuration error Request 'configure' timed out after 30000ms
2026-02-28T13:57:50.675+08:00 [warning] [pet] Request timed out, killing hung process for restart
2026-02-28T13:57:50.675+08:00 [error] [pet] Error refreshing Request 'configure' timed out after 30000ms
2026-02-28T13:57:50.675+08:00 [info] Pyenv not found, turning off pyenv features. [Error: Request 'configure' timed out after 30000ms
	at Timeout.<anonymous> (/Users/ponponon/.trae/extensions/ms-python.vscode-python-envs-1.20.1-universal/dist/extension.js:2:534062)
	at listOnTimeout (node:internal/timers:588:17)
	at process.processTimers (node:internal/timers:523:7)]
2026-02-28T13:57:50.676+08:00 [info] [interpreterSelection] Applying initial environment selection for 1 workspace folder(s)
2026-02-28T13:57:50.677+08:00 [error] [interpreterSelection] Failed to set environment for /Users/ponponon/Desktop/code/me/github/nanobot: Error: Python Environment Tools (PET) failed after 3 restart attempts. Please reload the window or check the output channel for details. To debug, run "Python Environments: Run Python Environment Tool (PET) in Terminal" from the Command Palette.
2026-02-28T13:57:50.678+08:00 [info] [interpreterSelection] global: none (source: autoDiscovery)
2026-02-28T14:04:26.436+08:00 [info] Refreshing poetry environments

遇到就需要 reload windows 才能,但是 reload 没正常几分钟后又会崩溃

解决方案

preview

把这个插件的版本从 1.20.1 降级到 1.16.0 就好了