I'm trying to install opencv on my Ubuntu 15.04 server. I'm using the conda package manager.

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

When I try importing cv2, the Python package, I get the following error.

ImportError: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

How do I install this dependency? I tried apt-get installing libgtk-x11-2.0.so.0 but it doesn't seem to exist.



At least in Ubuntu 16.04, libgtk2.0-0 contains libgtk-x11-2.0.so.0, so this works:

apt-get install libgtk2.0-0
  • it works. thanks. I spent a lot of time to get to here – zono Sep 4 '17 at 14:47
  • 1
    BEWARE. I only copied apt-get install libgtk2.0- and that removed almost all of my system. – Ondra Žižka Aug 4 '18 at 19:14
  • 4
    Didn't work in Ubuntu 18.04. – Ondra Žižka Aug 4 '18 at 20:55
  • worked on raspbian buster too – Philippe Gachoud May 4 '20 at 13:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.