"import pygame" is not working [duplicate]

I'm just trying to build some Python game, but import pygame is not working.

I got this error massage:

/usr/bin/python3 /home/dinushi/
Traceback (most recent call last): File "/home/dinushi/", line 2, in <module> import pygame
ModuleNotFoundError: No module named 'pygame'
2

1 Answer

You need to install the pygame module (no need to use sudo):

pip3 install --user pygame

Another way to install is by sudo apt-get install python3-pygame

7

You Might Also Like