简体   繁体   English

CentOS 7上适用于Python3.5的Pygame

[英]Pygame for Python3.5 on CentOS 7

Thanks in advance for the help. 先谢谢您的帮助。

I am trying to install Pygame for Python 3.5. 我正在尝试为Python 3.5安装Pygame。

I have spent many hours doing research and found that it was possible for Windows, yet nothing about CentOS. 我花了很多时间进行研究,发现Windows可以实现,但CentOS却一无所获。

Is it possible to install Pygame for Python 3.5 on CentOS 7? 是否可以在CentOS 7上为Python 3.5安装Pygame?

If so, how can i do it? 如果是这样,我该怎么办?

I have tried many commands, all of which have not worked. 我尝试了许多命令,但所有命令均无效。 Thanks for the help 谢谢您的帮助

You can compile pygame from source code. 您可以从源代码编译pygame。

1) Get dependances: 1)获得依赖:

yum install python3 python3-tools python3-devel SDL SDL-devel portmidi portmidi-devel ffmpeg ffmpeg-devel SDL_image-devel SDL_mixer-devel SDL_ttf-devel libjpeg-turbo-devel  
cd /usr/lib  
ln -s libportmidi.so libporttime.so  

2) Get pygame source code: 2)获取pygame源代码:

svn co svn://seul.org/svn/pygame/trunk pygame
cd pygame

3) Then config, compile and install: 3)然后配置,编译并安装:

python3 config.py
python3 setup.py build
python3 setup.py install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM