Skip to content

requirements.txt parsing breaks on inline comments #431

@Erquint

Description

@Erquint
## ComfyUI-Manager: EXECUTE =>
['E:\\Programs\\Runtimes\\ComfyUI\\venv\\Scripts\\python.exe', '-m', 'pip',
'install', 'matplotlib>=3.3.0  # For visualization in test scripts']
ERROR: Invalid requirement: 'matplotlib>=3.3.0  # For visualization in test scripts': Expected comma (within version specifier), semicolon (after version specifier) or end
    matplotlib>=3.3.0  # For visualization in test scripts
              ~~~~~~~~~^
Traceback (most recent call last):
  File "E:\Programs\Runtimes\ComfyUI\venv\Lib\site-packages\comfyui_manager\legacy\manager_core.py", line 1350, in repo_install
    if not postinstall():
           ^^^^^^^^^^^^^
  File "E:\Programs\Runtimes\ComfyUI\venv\Lib\site-packages\comfyui_manager\legacy\manager_core.py", line 1345, in postinstall
    return self.execute_install_script(url, repo_path, instant_execution=instant_execution, no_deps=no_deps)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Programs\Runtimes\ComfyUI\venv\Lib\site-packages\comfyui_manager\legacy\manager_core.py", line 852, in execute_install_script
    res = res and try_install_script(url, repo_path, install_cmd, instant_execution=instant_execution)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Programs\Runtimes\ComfyUI\venv\Lib\site-packages\comfyui_manager\legacy\manager_core.py", line 1860, in try_install_script
    code = manager_funcs.run_script(install_cmd, cwd=repo_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Programs\Runtimes\ComfyUI\venv\Lib\site-packages\comfyui_manager\legacy\manager_core.py", line 1662, in run_script
    subprocess.check_call(cmd, cwd=cwd, env=get_script_env())
  File "C:\Users\Erquint\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['E:\\Programs\\Runtimes\\ComfyUI\\venv\\Scripts\\python.exe', '-m', 'pip', 'install', 'matplotlib>=3.3.0  # For visualization in test scripts']' returned non-zero exit status 1.
ERROR: An error occurred while installing
'comfyui-eric-image-processing-nodes'.
Install(git-clone) error[2]:
https://github.com/EricRollei/Eric_Image_Processing_Nodes / Command
'['E:\\Programs\\Runtimes\\ComfyUI\\venv\\Scripts\\python.exe', '-m', 'pip',
'install', 'matplotlib>=3.3.0  # For visualization in test scripts']' returned
non-zero exit status 1.

The workaround that helps is…

  1. (venv) PS E:\Programs\Runtimes\ComfyUI> comfy node install comfyui-eric-image-processing-nodes@latest --no-deps
  2. (venv) PS E:\Programs\Runtimes\ComfyUI> python -m pip install -r E:\Programs\Runtimes\ComfyUI\installation\custom_nodes\comfyui-eric-image-processing-nodes\requirements.txt

Because the native PIP requirements installer doesn't choke on inline comments. You somehow implement it incorrectly.

Additionally, this failure seems to leave git objects in a locked state out of sync with ComfyUI's normal operation, so it fails to even uninstall correctly afterwards, but that's a whole can of worms that should be manageably avoided if you fix this bug…

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions