0

I am running windows 7, python 2.7 and pygame 1.9.2a0. Running

import pygame.camera
import pygame.image
import sys
pygame.camera.init()

I get the following error:

Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
pygame.camera.init()
File "C:\Program Files (x86)\Python3.4-32bit\lib\site-packages\pygame\camera.py", line 42, in init
from pygame import _camera
ImportError: cannot import name '_camera'

According to the stackexchange question at: How to open camera with pygame in Windows? this should work (at least it was accepted as answer for windows 7, python 2.7 and pygame 1.9.1)

Does anybody have a good suggestion why this does not work (or why it did work for Debujang in the above link and does not work for me?)

I am grateful for any help that will ultimatively allow me to stream the picture of the webcam to a figure and capture a frame from within python.

Thanks!

Community
  • 1
  • 1
user1638145
  • 1,979
  • 2
  • 14
  • 14
  • The camera extension is [only enabled on linux builds](https://bitbucket.org/pygame/pygame/commits/55a175eb7c7bd1d2408f2a2c534b1e9b31ca9028) by default. Try the [unofficial pygame binaries](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame) and also install [VideoCapture](http://www.lfd.uci.edu/~gohlke/pythonlibs/#videocapture) – cgohlke Jul 24 '16 at 20:40
  • I tried installing VideoCapture, but it complains that it cannot find zlib and if I try to install it by using pip install pillow --global-option="--disable-zlib" i get the message unknown optiom disable-zlib. Seems that I am too stupid to install VidoeCapture... Hints? – user1638145 Jul 26 '16 at 19:25
  • 1
    Ok, sorry, I am actually using python 3.4 not 2.7. For 2.7, pygame did not want to install correctly - no idea what was going wrong. But in any case I tried with python 3.4 for which I have a running pygame. but VideoCapture needs pillow and pillow refuses to install under python 3.4. as stated in the second comment... – user1638145 Aug 01 '16 at 15:07

0 Answers0