How to install Pygames on Manjaro?

hey there ,
i was learning python programming language. so in order to take my learning to the next level , i was trying to make a game using Pygame with the help of a tutorial. my python version is 3.8 , i installed pip 20.2.3 . after this i kinda got lost . the tutorial which i was trying to install pygames seems to be obsolete.
so , can you guys please help me out instaling pygames ?

Have you tried sudo pacman -S python-pygame ?


no i haven’t , but i did tried " sudo pacman -S pygame " :grin: , sorry , i didn’t knew this . i googled this and i only found one thread which is python2 oriented . thanks by the way . it worked

1 Like

also , the tutorial is asking me to get install these two

$ sudo apt-get install python3-dev mercurial
$ sudo apt-get install libsdl-image1.2-dev libsdl2-dev libsdl-ttf2.0-dev

is this necessary , or is this available on pacman ?

They are probably available, just called something different.

1 Like

hey ,
when i tried including pygame module in pycharm it’s giving me a traceback like this

/home/f/PycharmProjects/alien_invasion/venv/bin/python /home/f/PycharmProjects/alien_invasion/
Traceback (most recent call last):
File “/home/f/PycharmProjects/alien_invasion/”, line 2, in
import pygame
ModuleNotFoundError: No module named ‘pygame’

Process finished with exit code 1

but then i opened python3 in terminal and typed " import pygame " it returned me the installed pygame version. am i missing anything major here ?

Pycharm seems to be running in a virtual environment, so you probably need to do a pip install pygame in that environment.
The pacman commands installs it for system use.

1 Like

thanks again :kissing_heart:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.