安装pygame与easy_install错误

时间:2013-12-08 12:15:05

标签: python linux ubuntu pygame

我尝试使用easy_install安装pygame但不幸的是它无法正常工作......以下是shell的输出:

Searching for pygame
Reading http://pypi.python.org/simple/pygame/
Reading http://www.pygame.org/
Reading http://www.pygame.org/download.shtml
Best match: pygame 1.9.1release
Downloading http://www.pygame.org/ftp/pygame-1.9.1release.zip
Processing pygame-1.9.1release.zip
Running pygame-1.9.1release/setup.py -q bdist_egg --dist-dir /tmp/easy_install-OZaKoo/pygame-1.9.1release/egg-dist-tmp-2a4m8V


WARNING, No "Setup" File Exists, Running "config.py"
Using UNIX configuration...


Hunting dependencies...
SDL     : found 1.2.14
FONT    : found
IMAGE   : found
MIXER   : found
SMPEG   : found 0.4.5
PNG     : found
JPEG    : found
SCRAP   : found
PORTMIDI: found
PORTTIME: found

If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.


Continuing With "setup.py"
warning: no files found matching 'readme.txt'
no previously-included directories found matching '*/CVS'
no previously-included directories found matching '*/*/CVS'
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/pygame.h:75,
                 from src/imageext.c:47:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
src/imageext.c: In function ‘write_jpeg’:
src/imageext.c:315:9: warning: variable ‘lines_written’ set but not used [-Wunused-but-set-variable]
src/imageext.c:313:9: warning: variable ‘row_stride’ set but not used [-Wunused-but-set-variable]
src/imageext.c: In function ‘SaveJPEG’:
src/imageext.c:391:9: warning: variable ‘alpha’ set but not used [-Wunused-but-set-variable]
src/imageext.c: In function ‘initimageext’:
src/imageext.c:659:15: warning: variable ‘module’ set but not used [-Wunused-but-set-variable]
src/mixer.c: In function ‘chan_set_volume’:
src/mixer.c:660:9: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
In file included from /usr/include/python2.7/Python.h:8:0,
                 from src/scrap.h:22,
                 from src/scrap.c:30:
/usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:215:0: note: this is the location of the previous definition
In file included from src/scrap.c:59:0:
src/scrap_x11.c: In function ‘_get_data_as’:
src/scrap_x11.c:567:17: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
src/scrap_x11.c: In function ‘pygame_scrap_get_types’:
src/scrap_x11.c:825:9: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type [enabled by default]
/usr/include/python2.7/dictobject.h:114:17: note: expected ‘Py_ssize_t *’ but argument is of type ‘int *’
src/scrap.c: In function ‘initscrap’:
src/scrap.c:329:15: warning: variable ‘mod’ set but not used [-Wunused-but-set-variable]
In file included from src/_camera.c:36:0:
src/camera.h:42:32: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

我已经尝试过这些命令,我​​在其他线程上看到了:

sudo apt-get install python-dev

sudo apt-get install libevent-dev

感谢任何帮助:D我很抱歉,但我是一个真正的ubuntu noob:P

1 个答案:

答案 0 :(得分:3)

sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev

sudo apt-get install python-pygame