I’m having some fun with pygame, a library to create games in Python.
The exact steps to follow to have pygame in Python 3 on Fedora Linux are detailed in the Python Fun blog. In essence:
- yum install python3 python3-tools python3-devel
- yum install SDL SDL-devel portmidi portmidi-devel ffmpeg ffmpeg-devel SDL_image-devel SDL_mixer-devel SDL_ttf-devel libjpeg-turbo-devel
- cd /usr/lib64 &&Â ln -s libportmidi.so libporttime.so
This takes care of all dependencies needed (minus smpeg which does not exist in recent Fedora Linux distributions). Then:
- Get the pygame source code (e.g.Â hg clone https://bitbucket.org/pygame/pygame)
- python3 config.py
- python3 setup.py build
- python3 setup.py install
That’s it! Test by running python3 and importing pygame.
Have fun creating games ;-)
Avinash Meetoo says
A brief note to myself:
To create a virtual environment using Python 3, issue:
mkvirtualenv –python=`which python3` name_of_project
then use pip3 to install modules.