ComfyUI-Manager: Failed to initialize: Bad git executable (fix)
Failed to initialize: Bad git executable. means GitPython cannot find the git program, so ComfyUI-Manager does not load. We reproduced it with ComfyUI v0.37.0 and fixed it two ways.
1. The error
ComfyUI v0.37.0 with ComfyUI-Manager (commit 7e1af9c) in custom_nodes/, started with a PATH that has no git on it:
[ERROR] Failed to execute startup-script: ComfyUI/custom_nodes/ComfyUI-Manager/prestartup_script.py / Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh(<full-path-to-git-executable>)
All git commands will error until this is rectified.
This initial message can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|silent|none|n|0: for no message or exception
- warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
- error|e|exception|raise|r|2: for a raised exception
Example:
export GIT_PYTHON_REFRESH=quiet
The same message comes back as ImportError: Bad git executable. from GitPython (git/cmd.py, called from git/__init__.py on import), and the Manager does not load:
[WARNING] Cannot import ComfyUI/custom_nodes/ComfyUI-Manager module for custom nodes: Failed to initialize: Bad git executable.
[INFO] 0.0 seconds (IMPORT FAILED): ComfyUI/custom_nodes/ComfyUI-Manager
ComfyUI itself still starts (our --quick-test-for-ci run exited with status 0); only the Manager menu is missing. GitPython is installed; what it cannot find is the git program it shells out to.
2. Fix A: install git and put it on PATH
Linux: install your distribution's git package. Windows: install Git for Windows and keep the option that adds git to PATH, then open a new terminal (or reboot) so ComfyUI inherits the new PATH. Check from the same shell that starts ComfyUI:
git --version
3. Fix B: point GitPython at git directly
If git is installed but not on ComfyUI's PATH (a service, a launcher, the portable build), set the full path:
# Linux / macOS
export GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git
# Windows (cmd), e.g. in run_nvidia_gpu.bat before python
set GIT_PYTHON_GIT_EXECUTABLE=C:\Program Files\Git\cmd\git.exe
With the same restricted PATH plus GIT_PYTHON_GIT_EXECUTABLE set to /usr/bin/git, the startup had no "Bad git executable" and no IMPORT FAILED line. GIT_PYTHON_REFRESH=quiet only silences the message; the Manager still needs git to install and update nodes.
4. No module named 'git'
That is the Python package GitPython, not the git program. Current ComfyUI-Manager installs its own requirements at startup: after we uninstalled GitPython, the next start printed ## ComfyUI-Manager: installing dependencies. and + gitpython==3.2.1. If that fails, install it into ComfyUI's Python: python -m pip install -r custom_nodes/ComfyUI-Manager/requirements.txt.
Related: ComfyUI: No module named 'gguf' · ComfyUI: No module named 'sqlalchemy' · ComfyUI: No module named 'av'
Frequently asked questions
Does ComfyUI still work with this error?
Yes. ComfyUI starts; only ComfyUI-Manager is marked IMPORT FAILED, so its menu is missing.
Is GitPython missing?
No. GitPython is installed; it cannot find the git program. Install git or set GIT_PYTHON_GIT_EXECUTABLE to its full path.
Written with AI assistance. Measured on 2026-10-24 on Linux, CPython 3.11.17: ComfyUI v0.37.0, ComfyUI-Manager 7e1af9c, GitPython 3.2.1, with PATH lacking git, then with GIT_PYTHON_GIT_EXECUTABLE set. Output pasted unedited except shortened paths. PlainTables is our extension; ComfyUI, ComfyUI-Manager and git are free.