New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No module named _camera #76
Comments
Original comment by cgohlke (Bitbucket: cgohlke, GitHub: cgohlke): Not all pygame binary distributions include the _camera.pyd extension. Try pygame-1.9.2pre.win32-py2.7.exe from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame |
Original comment by Anonymous: Thank you, the above problem is solved. "import pygame from pygame import camera pygame.init() pygame.camera.init() window = pygame.display.set_mode((640,480),0) cam = pygame.camera.Camera(0) cam.start() image = cam.get_image() pygame.image.save(window,'abc.jpg') cam.stop()" It also opens the pygame window but that is also blank, and it goes to the NOT RESPONDING state in a seconds time. |
Original comment by Anonymous: I don't understand what that means: "Changed component from nothing to camera." " import pygame import pygame.camera from pygame.locals import * " it still does not work ? Any suggestions ? |
Original comment by Anonymous: Oh ok now i get it .. I just got it to work .. Here's a simple code : """ import pygame import pygame.camera from pygame.locals import * import time pygame.init() pygame.camera.init() size = (640,480) d = pygame.display.set_mode(size,0) s = pygame.surface.Surface(size,0,d) cam = pygame.camera.Camera(0,size) cam.start() s = cam.get_image(s) p=("outimage.jpg") pygame.image.save(s,p) """ This opens the pygame window which still is "NOT RESPONDING" but the image is stored in the memory ... Hope this helps someone else trying out pygame. Now i was trying to change the frame rate, exposure time, etc . . Is it possible to control those by the pygame package ?? Any suggestion ?? |
Original comment by Anonymous: Hi, I had a look at the events loop but it is not very clear why that is required(is it just used to stop the camera on a certain event) ? could you kindly give me a small explanation. could i not directly use the self.cam.stop() command without the event check?? what does it mean "if e.type == QUIT or (e.type == KEYDOWN and e.key == K_ESCAPE)" I had an other problem with the query_image, once i put the command in then i get an error as : "" Traceback (most recent call last): File "C:/.... .py", line 49, in if self.cam.query_image(): AttributeError: Camera instance has no attribute 'query_image' """ I looked at the pygame files and it has no query_image instance, but all the sources say there is a query_image instance. Am i making a mistake or Is there any alternate i could use?? Is there any way to control the exposure rate as well ? What do you suggest ? Cheers |
Original comment by Anonymous: I am having the same problem as the original poster stated: "ImportError: No module names _Camera". I am running a program which works on Ubuntu 10.04 with Python 2.6.5 and PyGame 1.9.1 It does not work on Windows XP SP3 with ActiveState Python 3.1.3.5 and PyGame 1.9.1 In each case it does this:
(Strangely, the library file camera.py looks the same on both the working Ubuntu machine and the non-working XP machine in that it says "import _camera" on line 42 of both.) Any ideas? |
Originally reported by: Anonymous
Hi,
When ever a call to the pygame.camera.init() module is made, it raises this error message : (this is under windows 7)
""
Traceback (most recent call last):
File "C:....py", line 1, in
pygame.camera.init()
File "C:\Python27\lib\site-packages\pygame\camera.py", line 42, in init
import _camera
ImportError: No module named _camera
""
Has any solution been found for this problem ??
The text was updated successfully, but these errors were encountered: