Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
199 views
in Technique[技术] by (71.8m points)

python - How can I force Pygame 2.0.0 to use the latest version of SDL?

your help on the below would be highly appreciated.

I am working on a python project for a RPi touch screen application. This comes with some issues on SDL 2.0.9, but are supposed to be solved in later versions. I have installed 2.0.14 through compilation, but Pygame persists in using SDL 2.0.9 (latest version in apt).

How can I force Pygame to use the compiled version?

Thanks! J

Issue raised in SDL 2.0.9 (occurs upon touch):

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 versions installed (from 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

compiled version:

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

2.0.14

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I just installed pygame in python 3.7.3 (what you have), 3.7.6 (latest v3.7.x I think), and python 3.9.1 (latest stable). In all of these versions, I am getting SDL 2.0.14. So you may just need remove the existing SDL and pygame, and reinstalling pygame should get you the later version of SDL.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...