Skip to content
Related Articles

Related Articles

Install Pygame in MacOS

Improve Article
Save Article
  • Last Updated : 09 May, 2021
Improve Article
Save Article

PyGame is a collection of modules that break through the language of Python applications. These modules are designed to edit video games. PyGame, therefore, includes computer graphics and audio libraries created for the use and language of Python programs.

At first, open the Terminal which is located at Applications -> Utilities -> Terminal and make sure that the Python3 is installed in your system. If it is not installed then type the below command.

brew install python3

Installing dependency

XCode: The first step for PyGame is to install Appleā€™s Xcode program. In your Terminal app, enter and run the following command to install XCode.

xcode-select --install

Be sure to click on all the verification recommendations that require XCode

Installing PyGame

We can now install the latest version of PyGame. Type the following command in Terminal and press Enter.

pip3 install pygame

To test if PyGame has been installed on your Mac, open terminal and type python, and import pygame as follows

If you don’t see any errors, it means that PyGame has been successfully installed on your Mac.

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!