Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency opencv-python>=4.9.0 doesn't work on old versions of macOS like 11.7 #999

Open
Steve235lab opened this issue Feb 5, 2024 · 4 comments
Labels
Bug Something isn't working

Comments

@Steve235lab
Copy link
Contributor

Describe the bug

I have the main branch of OI installed from source and tested on an old iMac which runs macOS 11.7.10. An error occurred when I tried to launch OI:

Traceback (most recent call last):
  File "/usr/local/bin/interpreter", line 5, in <module>
    from interpreter.terminal_interface.start_terminal_interface import main
  File "/usr/local/lib/python3.11/site-packages/interpreter/__init__.py", line 2, in <module>
    from .core.core import OpenInterpreter
  File "/usr/local/lib/python3.11/site-packages/interpreter/core/core.py", line 17, in <module>
    from .computer.computer import Computer
  File "/usr/local/lib/python3.11/site-packages/interpreter/core/computer/computer.py", line 9, in <module>
    from .skills.skills import Skills
  File "/usr/local/lib/python3.11/site-packages/interpreter/core/computer/skills/skills.py", line 3, in <module>
    import aifs
  File "/usr/local/lib/python3.11/site-packages/aifs/__init__.py", line 1, in <module>
    from .search import search
  File "/usr/local/lib/python3.11/site-packages/aifs/search.py", line 14, in <module>
    from unstructured.partition.auto import partition
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/auto.py", line 81, in <module>
    from unstructured.partition.pdf import partition_pdf
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/pdf.py", line 76, in <module>
    from unstructured.partition.pdf_image.pdf_image_utils import (
  File "/usr/local/lib/python3.11/site-packages/unstructured/partition/pdf_image/pdf_image_utils.py", line 9, in <module>
    import cv2
ImportError: dlopen(/usr/local/lib/python3.11/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj
  Referenced from: /usr/local/lib/python3.11/site-packages/cv2/.dylibs/libvmaf.1.dylib (which was built for Mac OS X 12.0)
  Expected in: /usr/lib/libc++.1.dylib

Obviously, this error was caused by the line import cv2. So I tried to run import cv2 directly in interactive python environment, and the same error was thrown. Then I tried to uninstall opencv-python and re-install opencv-python==4.8.1.78, the error was no longer thrown and seems everything works in OI.

So should we limit the version of dependency opencv-python = ">=4.8.1.78,<4.9.0" in pyproject.toml? Or we should just abandon users who are using an old macOS?

Reproduce

See the description.

Expected behavior

Limit dependency opencv-python = ">=4.8.1.78,<4.9.0" in pyproject.toml or add an handler for this import error if you want OI support old versions of macOS. Or just throw a clear deny-to-run message when detects OI running on those OSs.

Screenshots

No response

Open Interpreter version

Built from source on updated main branch

Python version

3.11.4

Operating System name and version

macOS 11.7.10

Additional context

No response

@Steve235lab Steve235lab added the Bug Something isn't working label Feb 5, 2024
@Steve235lab
Copy link
Contributor Author

In short, opencv-python >= 4.9.0 is not compatible with old macOS. We should handle this.

@Notnaton
Copy link
Collaborator

Notnaton commented Feb 5, 2024

Are they working on a fix for this in opencv?

@Steve235lab
Copy link
Contributor Author

Are they working on a fix for this in opencv?

Someone opened an issue, but there's no response yet.

@Steve235lab
Copy link
Contributor Author

Are they working on a fix for this in opencv?

And it seems the way they will fix the problem is avoid installing the latest version on old systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants