Skip to content

Installing camelot-py breaks existing opencv-python package #645

@the-vindicar

Description

@the-vindicar

camelot depends on opencv-python-headless package, which pip allows to be installed side by side with regular opencv-python. But this actually leads to conflicts, as interpreter can import headless version of cv2 instead of the regular one afterwards.

Steps to reproduce the bug

  1. Create a venv and activate it
  2. pip install opencv-python
  3. pip install camelot-py[base]

Code

import numpy
import cv2

cv2.imshow('Black square', numpy.zeros((256, 256, 3), numpy.uint8))
cv2.waitKeyEx()

Expected behavior
Program shows a window with black square in it.

Actual behavior
Program fails, because installed headless dependency overrides regular opencv, but doesn't provide imshow() function.

Suggestion
Is it possible to create an extra of camelot package that depends on regular version of opencv-python instead of headless version? This would allow camelot to co-exist with opencv-python in the same environment.

If you install packages in the opposite order, or if you uninstall opencv-python-headless and then force reinstall opencv-python, camelot functions just fine (I tested with lattice method), so it could use regular opencv-python instead.

Environment

  • OS: Windows 10
  • Python version: 3.13
  • Numpy version: 2.2.6
  • OpenCV version: 4.12.0
  • camelot version: 1.0.9

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