KohakuBlueleaf/PixelOE

cv2 not available before setup is run

Closed this issue · 2 comments

The setup script attempts to import command_map from pixeloe.cli before the dependencies (like opencv-python) are installed. While pixeloe.cli itself is safe, the import in pixeloe/__init__.py is not.

Could the command_map be moved someplace that does not trigger this import? Or possibly a lazy import of cv2?

Collecting pixeloe (from -r ./custom-node-requirements.txt (line 74))
  Downloading pixeloe-0.0.7.tar.gz (13 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-qnwn4hp3/pixeloe_c43a722c04e24d3cb3b585ca47da2d90/setup.py", line 2, in <module>
          from pixeloe.cli import command_map
        File "/tmp/pip-install-qnwn4hp3/pixeloe_c43a722c04e24d3cb3b585ca47da2d90/pixeloe/__init__.py", line 1, in <module>
          from .pixelize import pixelize
        File "/tmp/pip-install-qnwn4hp3/pixeloe_c43a722c04e24d3cb3b585ca47da2d90/pixeloe/pixelize.py", line 3, in <module>
          import cv2
      ModuleNotFoundError: No module named 'cv2'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Same cause as #2

Will be fixed recently

@ccesareo-psyop This should be fixed now (0.0.8)