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

 2023-09-06 阅读 24 评论 0

摘要:在引入pygame时出现无法找到SDL.h 文件,各种搜索后,在stackOverFlowO找到答案 这是问题,无法找到文件 [html]view plaincopy Infileincludedfromsrc/_numericsurfarray.c:23: src/pygame.h:106:10:fatalerror:'SDL.h'filenotfound #include<

在引入pygame时出现无法找到SDL.h 文件,各种搜索后,在stackOverFlowO找到答案

这是问题,无法找到文件

 

[html] view plain copy
  1. In file included from src/_numericsurfarray.c:23:  
  2. src/pygame.h:106:10: fatal error: 'SDL.h' file not found  
  3. #include <</span>SDL.h>  
  4.          ^  
  5. 1 error generated.  
  6. error: Setup script exited with error: command 'gcc' failed with exit status 1  

 

解决方法

 

[html] view plain copy
  1. brew install sdl sdl_image sdl_mixer sdl_ttf portmidi  
在终端执行上面的命令

 

然后执行下面的插入命令

pip installhttps://bitbucket.org/pygame/pygame/get/default.tar.gz

如果是python3 记得使用pip3 插入pygame

放原链接:阅读原文

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/9862.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息