Page 1 sur 1

[probleme] python open cv archlinux

Publié : lun. 24 juil. 2017, 19:37
par krobow
bonjour j'ai besoin d'aide car j'ai voulu installer la librairie python Open CV sur mon archlinux
j'ai fait: pacman -S opencv

j'ai vérifié que ça se voit bien installé en tapant ceci dans l'interpréteur python:
>>> import opencv
>>> import cv2

donc parfait a priori
puis j'execute un code minimaliste pour apprendre à utiliser cette librairie (copy paste d'un code de la documentation opencv):

import cv2

img = cv2.imread("ex.png", 0)
cv2.imshow("image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()

sachant que le nom de l'image est correct et qu'il est dans le meme dossier
j'execute ce code:
python learn.py
et voici le message d'erreur:

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /io/opencv/modules/highgui/src/window.cpp, line 583
Traceback (most recent call last):
File "learn.py", line 4, in <module>
cv2.imshow("image",img)
cv2.error: /io/opencv/modules/highgui/src/window.cpp:583: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage



comment installer proprement opencv sur arch ? merci

Re: [probleme] python open cv archlinux

Publié : lun. 24 juil. 2017, 20:20
par benjarobin
Bonjour,
Tu dois installer le paquet gtk2

Re: [probleme] python open cv archlinux

Publié : mar. 25 juil. 2017, 14:04
par krobow
fait. quand je run le code:
ImportError: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /usr/lib/libtbb.so.2)

Re: [probleme] python open cv archlinux

Publié : mar. 25 juil. 2017, 15:59
par benjarobin
Ton système est bien intégralement à jour ?
Ne jamais lancer une telle commande : pacman -Sy paquet toujours faire pacman -Syu paquet ou pacman -S paquet
En gros ne jamais avoir l'option -y seule !