首页 > 解决方案 > 运行 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)

标签: pygameraspberry-pi

解决方案


我在 Raspberry Pi 中解决它,从零开始设置,删除 micro SD 卡中的所有内容并再次安装 Raspberry Pi OS,问题是我试图在终端上安装 pygame 但已经安装在 Raspberry Pi 上,所以可能是安装过程中出错。


推荐阅读