mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1508] Python import verification fails when torch prints warning despite JSON success #443
Labels
No labels
area: desktop-app
Bounty
bug
bug-cop:answered
bug-cop:response-received
component: installer
component: preload
custom node
dependencies
Design
documentation
duplicate
enhancement
expected
frontend
good first issue
installation
Low-Priority
performance
Planned
platform: cross-platform
platform: windows
Potential Bug
Potential Bug
pull-request
question
refactor
Release
stale
User Support
V1
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/desktop#443
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @benceruleanlu on GitHub (Jan 5, 2026).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1508
Summary
During startup import verification, extra output (warning) appears before the JSON result, causing JSON parsing to fail and the app to throw
PythonImportVerificationErroreven though the JSON sayssuccess: true.Environment
C:/Users/...)Steps to reproduce
Expected
Import verification should pass when the JSON result is successful, even if other output is present.
Actual
Import verification fails and triggers the reinstall/ignore prompt.
Logs
Followed by:
Suspected cause
src/services/pythonImportVerifier.tsconcatenates stdout and stderr into a singleoutputstring and then runsJSON.parse(output).torchduring import) makes the JSON invalid, so the verifier returnssuccess: falseeven if the JSON result is successful.src/virtualEnvironment.tswhenverifyPythonImports()returns false.Possible fixes
{...}and parse that).┆Issue is synchronized with this Notion page by Unito
@dosubot[bot] commented on GitHub (Jan 5, 2026):
You’re correct about the cause: the current implementation concatenates both stdout and stderr into a single string and then tries to parse the whole thing as JSON. Any warning or extra output (like from torch) before the JSON will break parsing and trigger the verification error, even if the JSON result itself is successful. There’s no filtering or separation of output in the code right now, so any stray line will cause this failure see source.
Your suggested fixes are all valid approaches:
{...}) is a robust workaround.Any of these would make the verification much more robust. The most straightforward fix in the current codebase is to capture stdout and stderr separately and only parse stdout as JSON. If you need to work around this immediately, extracting the last JSON object from the combined output string before parsing is a practical short-term solution.
To reply, just mention @dosu.
Docs are dead. Just use Dosu.