Unable to open an image


#1

catImg = pygame.image.load(“cat.png”)
DISPLAYSURF.blit(catImg, (catx, caty))

The above code is written in Python/Pygame.

It runs successfully in Thonny, but gets the following error in Atom “pygame.error: Couldn’t open cat.png”


#2

What happens if you enter the absolute file path of cat.png?

Since Atom can’t run Python code, you must be using a package. You should identify that package when asking for help.