- The current version of Pygame at the time this book was written is 1.9.1. If you see a newer version on the website, download and install the newer Pygame. For Mac OS X, download the.zip or.dmg file for the version of Python you have and run it. For Linux, open a terminal and run “ sudo apt-get install python-pygame ”.
- Here is a quick tutorial on how to get Pygame up and running with Python 3 on a Mac with OS X 10.6. Rationale The Pygame download site presently has packages for Python 2.4, 2.5, 2.6 and 2.7 for OS X, but none for Python 3 (3.2 to be precise).
- Pygame, free and safe download. Pygame latest version: Community-Based Python Game Development. Pygame is a set of Python modules for developing video games. This development and I.T.
I recently installed PyGame 1.9.1 on Mac OS X 10.6 (Snow Leopard) running Python 3.1 - (instructions at the bottom of the page. Cheers, and good luck! (Paul Barry, Dec 2009). A method of installing pygame on Mac OS X 10.7 (Lion) Here's how I installed PyGame 1.9.1 on Mac OS X 10.6 (Snow Leopard) for Python 2.7.2. Mountain Lion install. Get code examples like.
Mon, Sep 28, 2015Tags: pythonpygametutorial
Making games is a great way to improve your programming skills while making something fun at the same time. Pygame is a set of tools for Python that make it easy to work with graphics and sound.
Unfortunately, installing Pygame is not as easy as using it is. Below you’ll find the best directions we’ve found for getting it working on your system. Follow the directions below, and let us know in the comments below if you have any problems.
Note: For most of these instructions you will need to use the command line. Don’t be intimidated - programmers work on the command line all the time. Once you get used to it, you’ll find it’s the quickest and easiest way to do lots of useful things on the computer.
You access the command line by running the Terminal application - click on the Spotlight icon and type “terminal” to find it.
Step 1: Install XCode command line tools
XCode is the tool from Apple for creating Mac and iOS applications. It can be installed from the App Store (it’s free). When it’s finished, type the following at the command line:
Step 2: Install Homebrew (http://brew.sh)
Homebrew is a tool to easily install all kinds of software from the command line. It saves you having to go to a bunch of different sites and download lots of individual installers. Copy and paste this on the command line:
and follow the directions. You’ll also need to install Homebrew Cask (http://caskroom.io):
How To Update Pygame
Step 3: Install the rest of the software
Now we can start installing all the requirements for Pygame. Just type the following commands one at a time and let the computer do its thing:
Step 4: See if it works!
How To Download Pygame On Mac
Now we can see if it works. Run Python from the command line:
and try loading Pygame:
If you don’t see an error message, you’re all set! Now head over to our YouTube Channel and start coding!
Important
You will not be able to use Pygame from IDLE. You will need to run your programs from the command line like this:
Some code editors will also let you run Python programs from inside the program, but we’ll talk about that in a separate post.
Step 1: Install Python
If you haven’t already, go to http://python.org/ and download the latest Python installer. Click on “Downloads” and choose “Download Python 3.5.0” (or whatever the latest version is).
When the download finishes, choose “run” - you may need to open your Downloads folder and double-click on the installer file.
Check the box labeled “Add Python 3.5 to PATH” and then click “Customize Installation”. Under “Optional Features” make sure all the boxes are checked. Under “Advanced Options” you can leave it as-is. Then click the Install button and let the computer complete the process.
Step 2: Install Pygame for Windows
Click here and download the appropriate installer for your computer. For most people, this will be the latest 32-bit installer, for example:
Choose “Save” and let the file download.
Now, you need to go to the command line. In your Start Menu search for “command” and you’ll see a button for “Command Prompt”.
Type the following:
Step3: See if it works!
Now we can see if it works. Run Python from the command line:
and try loading Pygame:
If you don’t see an error message, you’re all set! Now head over to our YouTube Channel and start coding!
Comments
Please enable JavaScript to view the comments powered by Disqus.From OLPC
This page describes a method for getting a native Pygame development environment set up for coding software for the OLPC Sugar platform while running on Mac OS X 10.4 on an Intel or PowerPC Mac.
|
Visit the Pythonmac download page and get the latest macpython2.4 package and the precompiled Pygame.
Prerequisites
- Xcode
If you don't have the Xcode development tools installed, insert your Mac OS X install CD and install the Xcode tools from there. Alternatively, you can download the 924MB (!) installation directly from Apple.
- X11
Install the X11 package from your Mac OS X install CD. I couldn't find a 10.4-compatible version on the web, so you're on your own if you can't find your installation disc.
Installing DarwinPorts
DarwinPorts is a package management system that makes it easy to install a bunch of open source software. You can download it here. Double-click the installer and follow the instructions on-screen.
Installing pygame
Once you have DarwinPorts installed, open a Terminal window. Make sure you have the latest version by running the following command:
Then, install pygame and its dependencies:
- Emulation -- alternate approach that runs an emulated machine on your Mac OS X machine
- Game development HOWTO -- Quick-start guide to getting a working Pygame activity in under 5 minutes
- Developers -- general entry point for how to get started coding for the Sugar environment