[probleme] python open cv archlinux
Publié : lun. 24 juil. 2017, 19:37
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
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