2013-12-08 79 views
0

我試圖用easy_install的安裝pygame的但遺憾的是它不工作...這裏是shell的輸出:與easy_install的錯誤安裝pygame的

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 

任何幫助表示讚賞:DI很抱歉,但我是一個真正的Ubuntu小白:P

回答

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

+0

aaaaayyyyy:d奏效!我嘗試了第一個命令,但它不起作用......但第二個工作很好^^我真的不明白爲什麼我沒有嘗試最簡單的方法首先大聲笑 –