import pygame, sys, gif_pygame
win = pygame.display.set_mode((512, 512))
gif = gif_pygame.load("animation.gif")
while True:
win.fill((0, 0, 0))
gif.render(win, (128-gif.get_width()*0.5, 256-gif.get_height()*0.5))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
модуль скачай через pip