How do you Install Pygame on Pydriod 3? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do you Install Pygame on Pydriod 3?

Pygame Game

4th Jun 2020, 12:24 PM
Divine Onyema
Divine Onyema - avatar
14 Answers
+ 5
Thank you guys!
4th Jun 2020, 1:03 PM
Divine Onyema
Divine Onyema - avatar
+ 1
Open app Tap the menu in top left corner Tap the "pip" option Search for pygame and install
4th Jun 2020, 12:28 PM
Slick
Slick - avatar
+ 1
Then pls how do you import it?
4th Jun 2020, 12:40 PM
Divine Onyema
Divine Onyema - avatar
+ 1
Is it with this line of code ? : import pygame_sdl2 pygame_sdl2.import as pygame ? Pls help me..
4th Jun 2020, 12:41 PM
Divine Onyema
Divine Onyema - avatar
+ 1
This should be one of your first lines: import pygame
4th Jun 2020, 12:42 PM
Slick
Slick - avatar
+ 1
Pls did it work for either of you? Pls give me an instance to check if it worked coz i created a width and height then added a caption i expected it was going to show at the top of my screen but it didn't pls what can i do to check if it worked?
4th Jun 2020, 12:50 PM
Divine Onyema
Divine Onyema - avatar
+ 1
Pls give me an instance to check if it works.. Thank you.
4th Jun 2020, 12:52 PM
Divine Onyema
Divine Onyema - avatar
+ 1
# opens a blank window import pygame pygame.init() surface_sz = 480 main_surface = pygame.display.set_mode((surface_sz, surface_sz)) while True: ev = pygame.event.poll() if ev.type == pygame.QUIT: break
4th Jun 2020, 12:58 PM
Slick
Slick - avatar
+ 1
Pls guys python still displayed an error saying i should rather use 'pygame sdl2 rather than pygame' for instance: pygame_sdl2.display.set_mode((5, 5)) I'm confused what can i do?
4th Jun 2020, 1:16 PM
Divine Onyema
Divine Onyema - avatar
+ 1
The warning came from the Graphical program output..
4th Jun 2020, 1:19 PM
Divine Onyema
Divine Onyema - avatar
+ 1
And when i run that code as a script in pydriod 3 it just show me Grasshopper app from play store with this i'm i assured that the pygame installion was successful?
4th Jun 2020, 1:20 PM
Divine Onyema
Divine Onyema - avatar
+ 1
On Pydroid pygame should be preinstalled, just import it to your program as pygame_sdl2 and you should be able to use it.
4th Jun 2020, 2:10 PM
Seb TheS
Seb TheS - avatar
+ 1
Go on www.python.org
5th Jun 2020, 8:06 AM
《A$# ☆ $ING#》
《A$# ☆ $ING#》 - avatar
0
How to playing music in python using pydroid 3
1st Dec 2022, 4:33 PM
MOHAMMAD IMRAN
MOHAMMAD IMRAN - avatar