…little BITS of our lives.

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:


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!

Comments on: "Installing Pygame Again!!! (This time with Fedora 16)" (7)

  1. yum install python3-devel
    Gives me a nothing to do error. Is this the correct install command?

    • Hi! Sorry for the late reply. Hope u already solved your problem.
      But ‘nothing to do’ message is not an error. It just means that u already have all the packages that get installed with that command. I would recommend that you try the next steps, and if it still doesn’t install, feel free to post your log at some place where i can look at them. (For ex: imagebin.org).
      Have fun!

  2. archetypechris said:

    ok, I got this to work on fresh install of fedora 17 . To get this to work u must do this also( on top of following this guide)
    first follow this http://www.pygame.org/wiki/CompileRedHat?parent=index
    then after that type yum install gcc
    THEN follow this guide and it will work

    thanks for the guide!!!

  3. i wanna install pygame on Fedora 17.
    it’s possible with this tuto?
    thank you.

    • Hi!
      Although I haven’t tried it myself, I believe it will work just fine with fedora 17.
      archetypechris, above mentions he got it working :).

      Nyway, if u run into any problems feel free to tell me and I shall be happy to help.


  4. Hey,

    I’m trying to follow this guide for Fedora 19. When I run ‘python3 setup.py install’, I get:

    bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../libporttime.so when searching for -lporttime
    /bin/ld: skipping incompatible /lib/libporttime.so when searching for -lporttime
    /bin/ld: skipping incompatible /usr/lib/libporttime.so when searching for -lporttime
    /bin/ld: cannot find -lporttime
    collect2: error: ld returned 1 exit status
    error: command ‘gcc’ failed with exit status 1

    This is after creating the symlink mentioned in thist post. Do you have any ideas?

  5. […] exact steps to follow to have pygame in Python 3 on Fedora Linux are detailed in the Python Fun blog. In […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: