如何强制Pygame 2.0.0使用最新版本的SDL?

2024-10-02 00:34:22 发布

您现在位置:Python中文网/ 问答频道 /正文

非常感谢您在以下方面的帮助

我正在为RPi触摸屏应用程序开发一个python项目。这在SDL2.0.9上带来了一些问题,但应该在以后的版本中解决。我通过编译安装了2.0.14,但Pygame坚持使用SDL2.0.9(apt的最新版本)

如何强制Pygame使用编译版本

谢谢!J

SDL 2.0.9中提出的问题(触摸时发生):

pygame 2.0.0 (SDL 2.0.9, python 3.7.3)
Hello from the pygame community. https://www.pygame.org/contribute.html    
INFO: The key you just pressed is not recognized by SDL. To help get this fixed, please report this to the SDL forums/mailing list <https://discourse.libsdl.org/> EVDEV KeyCode 330

已安装SDL版本(来自apt):

dpkg -l | grep sdl

ii  libsdl2-2.0-0:armhf                  2.0.9+dfsg1-1+rpt1                  armhf        Simple DirectMedia Layer
ii  libsdl2-2.0-0-dbgsym:armhf           2.0.9+dfsg1-1+rpt1                  armhf        debug symbols for libsdl2-2.0-0
ii  libsdl2-image-2.0-0:armhf            2.0.4+dfsg1-1+deb10u1               armhf        Image loading library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-mixer-2.0-0:armhf            2.0.4+dfsg1-1                       armhf        Mixer library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-ttf-2.0-0:armhf              2.0.15+dfsg1-1                      armhf        TrueType Font library for Simple DirectMedia Layer 2, libraries

编译版本:

/usr/local/bin/sdl2-config --version

2.0.14

Tags: 版本layerlibrariesforlibraryaptsimplepygame
1条回答
网友
1楼 · 发布于 2024-10-02 00:34:22

我刚刚在Python3.7.3(您所拥有的)、3.7.6(我认为是最新的v3.7.x)和Python3.9.1(最新的稳定版本)中安装了pygame。在所有这些版本中,我都得到了SDL2.0.14。因此,您可能只需要删除现有的SDL和pygame,重新安装pygame将获得更高版本的SDL

相关问题 更多 >

    热门问题