Results 1 to 7 of 7

Thread: Can't get pygame working

  1. #1
    Join Date
    Jun 2009
    Location
    new York
    Beans
    461
    Distro
    Ubuntu 9.10 Karmic Koala

    Can't get pygame working

    So I'm learning python from the Head First series by O'Reilly (a great series for any one wanting to learn how to program in most any langauge), and we need the pygame library to do our GUI stuff. I ran
    Code:
     sudo apt-get install python-pygame
    and it accomplished successfully, how ever I keep getting errors that there is no module named pygame. Am I missing something here?
    :wq

  2. #2
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't get pygame working

    Which version of python are you using?

    Code:
    ~$apt-cache show python-pygame
    Package: python-pygame
    Priority: optional
    Section: universe/python
    Installed-Size: 4332
    Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
    Original-Maintainer: Ed Boraas <ed@debian.org>
    Architecture: amd64
    Source: pygame
    Version: 1.8.1release-1ubuntu1
    Replaces: python2.3-pygame, python2.4-pygame
    Provides: python2.5-pygame, python2.6-pygame
    Depends: python (<< 2.7), python (>= 2.5),
    The version in the repository works for python 2.x, not sure if you can run pygame with python 3.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  3. #3
    Join Date
    Jun 2009
    Location
    new York
    Beans
    461
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't get pygame working

    I'm using python3
    :wq

  4. #4
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't get pygame working

    Quote Originally Posted by c0mput3r_n3rD View Post
    I'm using python3
    I'm not sure if the pygame guys have ported to python3 yet (and their site is down, so I can't check), so you're better off using python2.6 which comes with ubuntu. Python3 is kinda new, and lacks support of 3rd party libraries.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  5. #5
    Join Date
    Jun 2009
    Location
    new York
    Beans
    461
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't get pygame working

    And that's what I'm finding while looking around for the answer, except the book I'm reading is only on Python3, and they're saying to use pygame. I believe that other versions are fairly different as well, as trying to run most of my simple python programs get errors with the built in version of python which I'm assuming to be 2.6?
    :wq

  6. #6
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't get pygame working

    Quote Originally Posted by c0mput3r_n3rD View Post
    And that's what I'm finding while looking around for the answer, except the book I'm reading is only on Python3, and they're saying to use pygame. I believe that other versions are fairly different as well, as trying to run most of my simple python programs get errors with the built in version of python which I'm assuming to be 2.6?
    There are subtle differences between the syntax in python2.6 to 3. The most obvious ones are the print statement becoming a function, that things like "xrange()" became "range()" (and the older range died), and "raw_input()" became "input()" (again, the original input() died).

    Wait for the site to come back and check if they have a debian package for python3. I've been reading that pygame has python3 support, so it's a matter of finding the right package or source code.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  7. #7
    Join Date
    Jun 2009
    Location
    new York
    Beans
    461
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Can't get pygame working

    Alright thanks. And that would explain the error messages on my simple print and input!
    :wq

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •