0

Hey Guys I'm using Raspberry Pi OS in my desktop I'm on a mission to make a game using Pygame in Python but I can't load the image in the Pygame GUI it's getting some errors. I have tried copying it's path and paste but the same error is visible hope you guys can solve this

import pygame 
pygame.init()
disp = pygame.display.set_mode((400,400))
pygame.display.set_caption("Hello")
pygame.image.load("img.png")
pygame.display.update()

OUTPUT : pygame 1.9.4.post1 Hello from the pygame community. https://www.pygame.org/contribute.html ALSA lib bluealsa-pcm.c:763:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA PCM: PCM not found

Chandral
  • 448
  • 1
  • 3
  • 19

2 Answers2

0

Your code has no errors, just open, and close because you don't have a while loop to keep it open. The alsa error should be asociated to your audio drivers... Check if you have any.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Pakium
  • 293
  • 2
  • 9
0

I am not sure if this is a good advice, but try to use older version of Python. I noticed that several errors occur when I use Pygame with the recent version of Python.

Jae
  • 26
  • 3