12

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

Community
  • 1
  • 1
krasin
  • 123
  • 1
  • 6

3 Answers3

28

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

Sam Hammamy
  • 10,819
  • 10
  • 56
  • 94
1

Try again by installing

conda install -c https//conda.binstar.org/menpo opencv3

Sabbir Bin Azad
  • 111
  • 1
  • 8
0

Had the same error on python3 .

Though it was working fine, and then it wasn't. Maybe I installed some other package that caused the conflict. None of the above solutions worked.

Resolution by uninstalling menpo and installing conda-forge :

conda install -c conda-forge opencv
Saleem Ahmed
  • 2,719
  • 2
  • 18
  • 31