PyInstaller Incompatible Library Versions

26 views
Skip to first unread message

Jessie Sui

unread,
Feb 7, 2020, 3:35:05 AM2/7/20
to PyInstaller
I am using OpenCV, which seems to relies on QtWidgets if I'm not wrong. When running the app, I get this error:

Traceback (most recent call last):

  File "scrip.py", line 6, in <module>

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module

    exec(bytecode, module.__dict__)

  File "site-packages/cv2/__init__.py", line 3, in <module>

ImportError: dlopen(/Users/jessiesui/projects/salvage/dist/scrip/cv2/cv2.cpython-36m-darwin.so, 2): Library not loaded: @loader_path/../QtWidgets

  Referenced from: /Users/jessiesui/projects/salvage/dist/scrip/cv2/cv2.cpython-36m-darwin.so

  Reason: Incompatible library version: cv2.cpython-36m-darwin.so requires version 5.13.0 or later, but QtWidgets provides version 5.9.0

Line 6 of scrip.py is "import cv2". I have tried to prevent QtWidgets from being added by putting "a.binaries = a.binaries - TOC([('QtWidgets',None,None)])" in my .spec file, but then OpenCV does not work (error message below) which is why I believe PyInstaller's OpenCV relies on QtWidgets.

Traceback (most recent call last):

  File "scrip.py", line 6, in <module>

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module

    exec(bytecode, module.__dict__)

  File "site-packages/cv2/__init__.py", line 3, in <module>

ImportError: dlopen(/Users/jessiesui/projects/salvage/dist/scrip/cv2/cv2.cpython-36m-darwin.so, 2): Library not loaded: @loader_path/../QtWidgets

  Referenced from: /Users/jessiesui/projects/salvage/dist/scrip/cv2/cv2.cpython-36m-darwin.so

  Reason: image not found


Is there a way for me to have QtWidgets provide the needed version? Thank you so much.
Reply all
Reply to author
Forward
0 new messages