mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1224] [Bug]: Fatal Error: 'No pyvenv.cfg file' and Maintenance screen cannot repair installation #341
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#341
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 @rickydeanbro on GitHub (Jul 18, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1224
App Version
v0.4.55
Expected Behavior
I expected the built-in "Troubleshoot" / "Maintenance" screen to successfully repair the installation. Specifically, I expected the "Reinstall ComfyUI" or "Reset virtual environment" options to fix the startup error and allow the application to launch again.
Actual Behavior
My ComfyUI Desktop app is broken and will not start. It gives the error "No pyvenv.cfg file". When I click "Troubleshoot" to go to the Maintenance screen, all repair actions like "Reinstall ComfyUI" and "Reset virtual environment" fail. I have tried running as an administrator and disabling my antivirus, but nothing works. The app is stuck in a loop and cannot repair itself.
Steps to Reproduce
The initial issue was a ModuleNotFoundError for the face_recognition package needed by a custom node. The current, more serious issue is that the application is now in an unrecoverable state after trying to fix the Python environment.
Steps to Reproduce the current bug:
Start with a working ComfyUI Desktop v0.4.55 installation.
Manually delete the .venv folder located inside the ComfyUI user directory (C:\Users\Ricky\Documents\ComfyUI in my case) to attempt to force a fresh Python environment setup.
Launch the ComfyUI Desktop application.
The application fails to start and automatically enters the "Maintenance" screen.
On the Maintenance screen, click the "Reinstall ComfyUI" button (or the "Reset virtual environment" button).
The installer runs but fails with an error (e.g., "Task failed to run" or an "Access is denied" error in the console).
Result: The application is now in a permanent startup failure loop. The built-in maintenance tools are unable to repair the installation, making the application unusable. The original workflow is no longer relevant as the core application will not launch.
Debug Logs
Browser Logs
Not applicable. The application fails to start before the browser-based UI loads. The error occurs during the initial launch process.
Settings JSON
The requested
comfy.settings.jsonfile could not be found. However, during troubleshooting, two differentconfig.jsonfiles were located and modified. Here are their contents:File 1:
%appdata%\comfy-ui-desktop\config.json{
"installState": "installed",
"detectedGpu": "nvidia",
"basePath": "C:\Users\Ricky\Documents\ComfyUI",
"versionConsentedMetrics": "0.4.51",
"selectedDevice": "nvidia",
"hasGeneratedSuccessfully": true
}
File 2:
C:\Users\Ricky\Documents\ComfyUI\user\default\ComfyUI-Manager\config.json{
"preview_method": "none",
"git_exe": "",
"use_uv": false,
"channel_url": "https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main",
"share_option": "all",
"bypass_ssl": false,
"file_logging": true,
"component_policy": "workflow",
"update_policy": "stable-comfyui",
"windows_selector_event_loop_policy": false,
"model_download_by_agent": false,
"downgrade_blacklist": "",
"skip_migration_check": false,
"always_lazy_install": false,
"network_mode": "public",
"db_mode": "cache"
}
Other
┆Issue is synchronized with this Notion page by Unito
@dosubot[bot] commented on GitHub (Jul 18, 2025):
Hi @bedgutz! I'm Dosu and I’m helping the desktop team.
This unrecoverable state happens because deleting the
.venvfolder removes critical files (likepyvenv.cfg) that the app expects to exist. The Maintenance tools are supposed to recreate the virtual environment, but on Windows, they often fail if there are permission issues, file locks, or leftover files from a previous install—especially if antivirus or another process is interfering. This leads to errors like "Access is denied" and prevents the repair scripts from fully resetting the environment, leaving the app stuck in a startup loop. The config files can also persist between installs, causing the app to try to start from a broken location and fail again [source 1] [source 2] [source 3].Workarounds that have helped others include: fully deleting both the
.venvdirectory and the%APPDATA%\ComfyUIconfig directory, then reinstalling to a new, empty folder; or manually recreating the virtual environment and installing dependencies from a terminal. If you can open a terminal in your ComfyUI folder, try running:If that doesn't work, a full wipe (delete the install folder and
%APPDATA%\ComfyUI) and a clean reinstall is the most reliable fix [source].Recent updates have improved some of this logic, but robust recovery from a broken venv is still a challenge, especially on Windows [source].
To reply, just mention @dosu.
Docs are dead. Just use Dosu.