Installing Pygame for Windows Step 1: Install Python Some code editors will also let you run Python programs from inside the program, but we’ll talk about that in a separate post. You will need to run your programs from the command line like this: $ python3 mygame.py You will not be able to use Pygame from IDLE. If you don’t see an error message, you’re all set! Now head over to our YouTube Channel and start coding! Important Run Python from the command line: $ python3Īnd try loading Pygame: > import pygame $ brew install sdl sdl_image sdl_ttf portmidi libogg libvorbis Just type the following commands one at a time and let the computer do its thing: $ brew cask install xquartz Now we can start installing all the requirements for Pygame. You’ll also need to install Homebrew Cask ( ): $ brew install caskroom/cask/brew-cask Copy and paste this on the command line: $ ruby -e "$(curl -fsSL )"Īnd follow the directions. It saves you having to go to a bunch of different sites and download lots of individual installers.
Homebrew is a tool to easily install all kinds of software from the command line. When it’s finished, type the following at the command line: $ xcode-select -install It can be installed from the App Store (it’s free). XCode is the tool from Apple for creating Mac and iOS applications. You access the command line by running the Terminal application - click on the Spotlight icon and type “terminal” to find it. 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.
Don’t be intimidated - programmers work on the command line all the time. Note: For most of these instructions you will need to use the command line. Follow the directions below, and let us know in the comments below if you have any problems. Below you’ll find the best directions we’ve found for getting it working on your system. Unfortunately, installing Pygame is not as easy as using it is. Pygame is a set of tools for Python that make it easy to work with graphics and sound. Making games is a great way to improve your programming skills while making something fun at the same time. Installing Pygame by Chris Bradfield Mon, Tags: