Pygame installed on windows, getting "pygame.error: Failed loading libwebp-7.dll" when trying to call pygame.image.load()

Question:

I’ve got python 3.9.1 running on a windows 10 machine. I have pygame 2.0.1 installed on my machine via pip

(python -m pip install https://github.com/pygame/pygame/releases/download/2.0.1/pygame-2.0.1-cp39-cp39-win_amd64.whl)

however on calling pygame.image.load("file.png") I get the error:

pygame.error: Failed loading libwebp-7.dll: The specified module could not be found.

I’ve tried installing through pip install pygame
and running the tests in pygame.tests but they run fine.

Answers:

I managed to fix this error by using the whl file at
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame
rather than from the github releases.
I’m not sure why this worked, but I hope anyone else having this issue is helped by this.

I ran into the same issue, but I discovered that it was due to the image being too low resolution for the size of window being drawn, swapping the image for a higher resolution version fixed the problem.

Answered By: Matthew Hinz