Python 2.7 无法识别Pygame摄像头模块

Python 2.7 无法识别Pygame摄像头模块,python-2.7,camera,pygame,Python 2.7,Camera,Pygame,我一直在尝试使用pygame摄像头模块,但无法将其初始化。我已经尝试过一些代码,我发现在论坛中经常会弹出这些代码来启动工作: import pygame import pygame.camera pygame.init() pygame.camera.init() 在这一点上,我收到一条信息,说: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Libra

我一直在尝试使用pygame摄像头模块,但无法将其初始化。我已经尝试过一些代码,我发现在论坛中经常会弹出这些代码来启动工作:

import pygame
import pygame.camera
pygame.init()
pygame.camera.init()
在这一点上,我收到一条信息,说:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/pygame/camera.py", line 42, in init
    import _camera
ImportError: No module named _camera
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/Library/Python/2.7/site packages/pygame/camera.py”,第42行,在init中
导入照相机
ImportError:没有名为\u camera的模块

我还使用dir(pygame)检查了pygame.camera模块是否确实存在。它不会出现在列表中。有什么想法吗?(在OS X 10.9.2上使用Python2.7.6和pygame 1.9.2pre)

您的问题在于您使用的是不受支持的操作系统。在
pygame.camera
模块的文档中,它说只支持Linux和v412摄像头。您可以找到其他一些可能适合您需要的模块


希望这有所帮助。

我可以知道您正在使用的python版本(例如python 2.7.4)以及当前使用的操作系统吗?