您的位置:首页 > 编程语言 > Python开发

python安装pygame无法找到SDL.h文件

2017-10-21 20:49 381 查看
在引入pygame时出现无法找到SDL.h 文件,各种搜索后,在stackOverFlowO找到答案
这是问题,无法找到文件
 

[html] view plain copy

In file included from src/_numericsurfarray.c:23:  

src/pygame.h:106:10: fatal error: 'SDL.h' file not found  

#include <</span>SDL.h>  

         ^  

1 error generated.  

error: Setup script exited with error: command 'gcc' failed with exit status 1  

 
解决方法
 

[html] view plain copy

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi  

在终端执行上面的命令
 
然后执行下面的插入命令
pip installhttps://bitbucket.org/pygame/pygame/get/default.tar.gz
如果是python3 记得使用pip3 插入pygame
放原链接:阅读原文
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐