I get the following error when importing opencv in python:
> python
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined symbol: hb_buffer_set_cluster_level
The system is Linux debian 4.7.0-1-amd64, stretch. I have created an environment for Python 3 in Anaconda:
conda create --name=envPython3 python=3 anaconda
source activate envPython3
and then installed OpenCV:
conda install -c https://conda.anaconda.org/menpo opencv3
It should be installed because
conda list | grep cv
returns
opencv3 3.1.0 py35_0 menpo
Everything works fine with Python 2
May be this post is related
The Python "ModuleNotFoundError: No module named 'cv2'" occurs when we forget to install the opencv-python module before importing it or install it in an incorrect environment. To solve the error, install the module by running the pip install opencv-python command.
Start the Python shell by typing python3 and then hit enter. You will be inside the Python shell where you can execute your Python code. Import the cv2 package which is the name of the OpenCV module. Type “import cv2” and hit enter.
i also had the same issue. I found an answer that may work for you. Try
source activate envPython3
conda install -c asmeurer pango
python
>>> import cv2
Please see this github link
Try again by installing
conda install -c https//conda.binstar.org/menpo opencv3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With