Unable to install Pygame using pip Unable to install Pygame using pip python python

Unable to install Pygame using pip


Steps to install PyGame using pip

  1. Install build dependencies (on linux):

    sudo apt-get build-dep python-pygame
  2. Install mercurial to use hg (on linux):

    sudo apt-get install mercurial

    On Windows you can use the installer: Download

  3. Use pip to install PyGame:

    pip install hg+http://bitbucket.org/pygame/pygame

    If the above gives freetype-config: not found error (on Linux), then try sudo apt-get install libfreetype6-dev and then repeat 3.

Alternative way:

# Grab sourcehg clone https://bitbucket.org/pygame/pygame# Finally build and installcd pygamepython setup.py buildsudo python setup.py install


Try doing this:

sudo apt-get install mercurialsudo pip install hg+http://bitbucket.org/pygame/pygame


An update to this may be required, as it stands in version 1.9.1 it should simply install using:

pip install pygame

However, it look like there is a bug with their pypi repository, see:https://bitbucket.org/pygame/pygame/issues/59/pygame-has-no-pypi-page-and-cant-be

So, if you want the most recent release, you have to point directly at the ftp file ala:

pip install http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz

I suppose this will be fixed in the 1.9.2 release but for now this works.

I would note that the answer supplied by Pratyush works as well, but requires the user to install mercurial if they don't have it and downloads the trunk version, so really, not ideal unless you absolutely need it.