The startup failure is a numpy ABI mismatch โ€” and the open PR cannot fix it as written

#10
by nootxlm - opened

The runtime error ends at app.py line 7, import easyocr, which imports cv2 and dies:

RuntimeError: module compiled against ABI version 0x1000009 but this version of numpy is 0x2000000 โ€” ImportError: numpy.core.multiarray failed to import

requirements.txt explains it: opencv-python-headless is pinned <4.3 โ€” a binary built against the numpy 1.x ABI โ€” while numpy itself is not pinned anywhere, so every rebuild resolves numpy 2.x. The binary and the array library it was compiled against no longer match.

I reproduced the pair in isolation: a pre-numpy-2 OpenCV binary with numpy 2.2.6 raises exactly this ImportError; the same binary with numpy 1.26.4 imports cleanly.

The PR screen matters here, because the fix looks closer than it is:

  • Open PR #9 adds numpy==1.23.5 and a newer opencv โ€” but as a new file named "Update requirements.txt", not as requirements.txt. Merged as written, it changes nothing the build reads.
  • Closed PR #6 had the right shape (it added numpy==1.26.4 to the real requirements.txt) but was never merged.

The minimal fix is one line in requirements.txt: numpy<2 (1.26.4 is the last 1.x), keeping the <4.3 opencv pin โ€” or, the other direction, raise opencv to a release built against numpy 2 and drop the <4.3 pin. Either makes the pair agree; the current file is the one combination that cannot.

Sign up or log in to comment