Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

python - Pygame Error: File is not a windows BMP file

I'm having problem following this tutorial. After I run it, an error message pops up

"ball = pygame.image.load("...) Error:File is not a Windows BMP file.

I'm on OSX 10.9.5

I highly suspect I messed up the installation for all the necessary components, and the my steps are the following when I install:

  1. Delete Python 3 and reinstall Python 2.7 32-bit version (using the .dmg)
  2. Install the pygame package using the .dmg
  3. Was asked to install X11, installed X11
  4. Open SDL framework .zip and drag and drop into a folder in Application/Library

Did I mess it up? Especially for the SDL? Please tell me the solution, thank you.

//Tried putting the image file in the same directory; saving the image file as .bmp

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)

I followed the solution here answer. Head to Macintosh HD/Library/Frameworks/..... and delete the pygame folder within and reinstall.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...