Skip to content

Conversation

@BlinkVoid
Copy link

@BlinkVoid BlinkVoid commented Jan 10, 2026

Summary

  • Fix ModuleNotFoundError: No module named 'utils.install_util'; 'utils' is not a package error

Problem

sys.path.insert(0, ...) in nodes.py line 22 places the comfy/ directory at the front of sys.path. When code later imports from utils.install_util import ..., Python finds comfy/utils.py (a module file) instead of the top-level utils/ package.

This breaks imports in:

  • app/frontend_management.py
  • app/database/db.py

Fix

Change sys.path.insert(0, ...) to sys.path.append(...) so the comfy/ directory is added at the end of sys.path, preserving normal import resolution order.

Test plan

  • Verified python main.py starts without import errors
  • Verified from utils.install_util import get_missing_requirements_message works after importing nodes

Change sys.path.insert(0, ...) to sys.path.append(...) to prevent the
comfy directory from being placed at the front of sys.path.

When comfy/ is at position 0, importing 'utils' finds comfy/utils.py
(a module file) instead of the top-level utils/ package, causing:
  ModuleNotFoundError: No module named 'utils.install_util'; 'utils' is not a package

This affects imports in app/frontend_management.py and app/database/db.py
which import from utils.install_util.

By using append() instead of insert(0, ...), the comfy directory is added
at the end of sys.path, preserving normal import resolution order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant