…little BITS of our lives.

Posts tagged ‘Install Pygame’

Installing Pygame Again!!! (This time with Fedora 16)

Hi again! This time, a friend of mine asked me to install pygame on his fedora machine to work with python3. Now I don’t have much experience with fedora, but I kinda liked it in the little time I have used it.

Anyways, coming back to the topic, this installation, took my entire afternoon, so I decided to make a post about it.

Fedora is shipped with python2 installed already, so the first thing is to install python3. Now since you are reading this, I will assume you already have python 3 installed.

What you should do is also install the ‘python3-devel’ package. Why?

Because if you don’t, somewhere down the line, your installation progress will stop by an error such as the following:

Image

So, fire up the command line and type in the following:

yum install python3-devel

Oh, one more thing! Do this as root user, but ur system probably already told u that. 😉

Once you are done, we have to install all the dependencies for pygame. These are basically some libraries, some of which might be present in your system already.

Anyways, go ahead and type in:

yum install SDL SDL-devel smpeg smpeg-devel portmidi portmidi-devel ffmpeg ffmpeg-devel

This will install the dependencies that you need in order to install pygame. Now, what we need to do is acquire pygame. You can do this by any method, for example by downloading the zipped file from the pygame website and then extracting it into your computer.

I prefer the method of acquiring pygame through ‘svn‘. Unfortunately, svn might not be installed on your computer. So, you can stick to other methods or ‘install svn’ :D.

If you don’t know what svn is, google it and you will get introduced to something really awesome! Moving ahead, if you decide to install svn, you can do this by:

yum install subversion

Now go and acquire pygame by typing this into your command line.

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

The download will begin in a moment, you will see a bunch of text appearing and then when the prompt comes again, move to the pygame folder.

cd pygame

Then type:

python3 config.py

python3 setup.py build

Sometimes an error pops in here, saying something like it can not find ‘-lporttime’. In order to resolve this issue, you just have to create a symbolic link to lportmidi as follows:

Move to /usr/lib

cd /usr/lib

Then type:

ln -s libportmidi.so.0 libporttime.so

For this one line I have this guy to thank: Vzades’s Blog 🙂

And then, just enter

python3 setup.py install

And you are done!!!

Happy times are back again, And I can go back to sipping my cola !!! 😀 😀

Fedora, ur ON!