Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k 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

1 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...