Pygame 错误:文件不是 windows BMP 文件 [英] Pygame Error: File is not a windows BMP file

查看:44
本文介绍了Pygame 错误:文件不是 windows BMP 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在学习这个教程时遇到问题.我运行后弹出错误提示

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

"ball = pygame.image.load("...) 错误:文件不是 Windows BMP 文件.

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

我使用的是 OSX 10.9.5

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. 删除 Python 3 并重新安装 Python 2.7 32 位版本(使用 .dmg)
  2. 使用 .dmg 安装 pygame 包
  3. 被要求安装X11,安装X11
  4. 打开 SDL 框架 .zip 并将其拖放到应用程序/库中的文件夹中

我搞砸了吗?特别是对于 SDL?请告诉我解决方案,谢谢.

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

//尝试将图片文件放在同一目录下;将图像文件另存为 .bmp

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

推荐答案

我按照这里的解决方案 回答.前往 Macintosh HD/Library/Frameworks/..... 并删除其中的 pygame 文件夹并重新安装.

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

这篇关于Pygame 错误:文件不是 windows BMP 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆