pygame - 运行 Street pyghter 的问题 - 1.2
问题描述
我正在尝试在我的 Raspberry Pi 4 上运行这个项目 ,但是出现了一些错误,比如缺少一些文件,以及未定义变量。
我试图改变和解决问题,但仍然没有工作。
有人有从零开始构建一个或新版本的教程吗?
在每个创建我自己或克隆的项目中,都会在终端上给我这个错误:
Hello from the pygame community. https://www.pygame.org/contribute.html /home/pi/Desktop/pygame/main.py:3: RuntimeWarning: use font: libSDL2_ttf-2.0.so.0: cannot open shared object file: No such file or directory (ImportError: libSDL2_ttf-2.0.so.0: cannot open shared object file: No such file or directory) pygame.font.init() Traceback (most recent call last): File "/home/pi/Desktop/pygame/main.py", line 3, in <module> pygame.font.init() File "/home/pi/.local/lib/python3.7/site-packages/pygame/__init__.py", line 59, in __getattr__ raise NotImplementedError(missing_msg)
解决方案
我在 Raspberry Pi 中解决它,从零开始设置,删除 micro SD 卡中的所有内容并再次安装 Raspberry Pi OS,问题是我试图在终端上安装 pygame 但已经安装在 Raspberry Pi 上,所以可能是安装过程中出错。
推荐阅读
- flutter - 在 Flutter 中使用类将参数作为列表传递
- arrays - 在 Swift 中等分一个大向量
- android - 为什么导航抽屉不适用于我的项目?
- mfc - 是否可以将 GUID 值转换为 DWORD?
- angular - Angular 8 与 Angular 9 捆绑包大小比较
- amazon-web-services - AWS,将多个域映射到一个网站,但路径不同
- ios - ios - 输入时在 UITextView 中替换/删除字符 [• ]
- c - 使用 pthread 调用方法时如何使用多个参数?
- sqoop - 用作边界查询时,有效的 MySQL 查询中断
- django - 没有函数匹配给定的名称和参数类型。您可能需要添加显式类型转换。Django Postgresql