Skip to content
Related Articles

Related Articles

Improve Article
Install Pygame in Linux
  • Last Updated : 16 May, 2021

In this article, we will discuss how to install PyGame in the Linux system. We are using Ubuntu 20 LTS you can use any other one.

To successfully install PyGame in your Linux system, follow the below procedure:

  • First Check you are using python’s latest version or not.

Because the PyGame is only supported python 3.7.7 or higher version so make sure you are using the latest version of python. Type the below command to the checl the version of the article.

python3 –version

Note: If Python is not installed refer to install python in the Linux system.



  • Check you are using pip latest version or not.

The pip is a python package installer, if you want to use any external package in your python file you first install it in your local system, so the pip tool is used. If you are already using the new pip version so follow the below steps if not, so refer to the article on how to install pip in the Linux system.

pip3 –version

  • Make root user and update Linux packages if you are not using the latest pip version.

Open the terminal and make sure you are the root user.

sudo su

Type your password and doing the below process as a root user and update Linux packages using the below command.



apt update

After doing the step you are ready to install PyGame in your Linux system.

Installing Pygame

Type the below command in your terminal and hit the enter key.

sudo apt-get install python3-pygame

This process will take time finally you successfully installed your PyGame module in your Linux system.

  • Check the PyGame is working or not.

Type below command and open your python interpreter and import PyGame.

Displaying the PyGame version indicates that the library is properly installed.

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :