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

import cv2 complain when installing quantus with python == 3.9 in virtual env #344

Open
annahedstroem opened this issue Mar 19, 2024 · 0 comments

Comments

@annahedstroem
Copy link
Member

Description

>>> python3.9 -m venv venvs/testenv
>>> source venvs/testenv/bin/activate
>>> pip install git+https://github.com/understandable-machine-intelligence-lab/Quantus.git # succesfully installs
>>> import quantus
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/quantus/__init__.py", line 11, in <module>
    from quantus.evaluation import evaluate
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/quantus/evaluation.py", line 19, in <module>
    from quantus.functions.explanation_func import explain
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/quantus/functions/explanation_func.py", line 17, in <module>
    from quantus.helpers import constants
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/quantus/helpers/constants.py", line 14, in <module>
    from quantus.functions.perturb_func import *
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/quantus/functions/perturb_func.py", line 14, in <module>
    import cv2
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/usr/local/Cellar/python@3.9/3.9.17_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/cv2/cv2.abi3.so, 2): Symbol not found: __ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE4openEPKcj
  Referenced from: /Users/annahedstroem/Projects/venvs/quantustrans/lib/python3.9/site-packages/cv2/.dylibs/libvmaf.1.dylib (which was built for Mac OS X 12.0)
  Expected in: /usr/lib/libc++.1.dylib

Steps to reproduce the behavior

Solution that works:

pip install opencv-python==4.8.1.78        

Minimum acceptance criteria

  • Specify what is necessary for the issue to be closed.
  • @mentions of the person that is apt to review these changes e.g., @annahedstroem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant