python - pygame.error: Couldn't allocate memory for PNG file or incompatible PNG dll -


i'm trying create simple space invaders pygame python class. haven't got anywhere far yet keep receiving image loading errors when try test out code. using python 2.7 pycharm. source code.

import pygame pygame.locals import *   pygame.init() width, height = 640, 480 screen = pygame.display.set_mode((width, height))  player = pygame.image.load("spacecraft.png")  #infinite loop while 1:     screen.fill(0)     screen.blit(player, (100,100))     pygame.display.flip()     #loop though events     event in pygame.event.get():         if event.type == pygame.quit:             #if quit game             pygame.quit()             exit() 

again should show black screen picture of spaceship in coordinates. however, when test out program shows error:

libpng warning: application built libpng-1.6.23 running 1.5.4 line 9, in <module> player = pygame.image.load("spacecraft.png") pygame.error: couldn't allocate memory png file or incompatible png dll 

i have tried re-installing pygame, python, , tried using os correctly path image. path image root checked off checklist. downloaded libpng.1.6.16 didn't work either. there way me fix this? btw i'm not familiar memory management. if need more information try answer best can.

thanks in advance!!


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -