yolanother / DTAIComfyVariables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No module named 'custom_nodes.DTGlobalVariables' error

tusharbhutt opened this issue · comments

I always get an error when loading

init.py", line 3, in
from custom_nodes.DTGlobalVariables import variables
ModuleNotFoundError: No module named 'custom_nodes.DTGlobalVariables'

commented

It shouldn't be importing like that, there, it's not a valid path. maybe if \custom_nodes\ was on PATH but still.
To work around it the cheep and dirty way for anyone lookin' is to edit the init.py and change
from custom_nodes.DTGlobalVariables import variables to
from . import variables

It's not working.

Traceback (most recent call last):
  File "D:\ComfyUI_windows_portable\ComfyUI\nodes.py", line 1735, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\DTAIComfyVariables\__init__.py", line 3, in <module>
    from . import variablesvariables
ImportError: cannot import name 'variablesvariables' from 'DTAIComfyVariables' (D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\DTAIComfyVariables\__init__.py)

Cannot import D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\DTAIComfyVariables module for custom nodes: cannot import name 'variablesvariables' from 'DTAIComfyVariables' (D:\ComfyUI_windows_portable\ComfyUI\custom_nodes\DTAIComfyVariables\__init__.py)

The error is cleared by making the following change to custom_nodes\DTAIComfyVariables_init_.py line 3:

- from custom_nodes.DTGlobalVariables import variables
+ from custom_nodes.DTAIComfyVariables import variables

However, the "Int" and "Float" nodes are not displayed in the field. They are available in the menu, available in the search, but selecting them adds nothing. The other nodes work.