marblexu/PythonPlantsVsZombies

Well I don't know.. (Kali Linux)

Davut-A opened this issue · 3 comments

I have installed pygame (sudo apt install python3-pygame) python3 is pre-installed
when i run
python3 main.py
it gives me
Traceback (most recent call last): File "/home/kali/github/PythonPlantsVsZombies/main.py", line 1, in <module> import pygame as pg File "/usr/lib/python3/dist-packages/pygame/__init__.py", line 92, in <module> from pygame.base import * # pylint: disable=wildcard-import; lgtm[py/polluting-import] ^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: Dynamic linking causes SDL downgrade! (compiled with version 2.28.2, linked to 2.28.1)
Help please!

The error message you're seeing is related to the version of SDL (Simple DirectMedia Layer) that your Python pygame module is trying to use. The error message specifically says:

"RuntimeError: Dynamic linking causes SDL downgrade! (compiled with version 2.28.2, linked to 2.28.1)"

This error occurs because pygame was compiled with a different version of SDL than the one it's trying to link to at runtime.

To resolve this issue, you have a few options:
try updating pygame: pip install --upgrade pygame

Downgrade SDL: If updating pygame doesn't work, you can try downgrading SDL to the version that pygame is expecting (2.28.1 in your case). You can use your package manager to do this. For example, if you're on Ubuntu, you can run:
sudo apt-get install libsdl2-2.0-0=2.0.10+dfsg1-3ubuntu1 Be sure to replace the version number with the one that matches what pygame is expecting

Build pygame from source: If neither of the above options works, you may need to build pygame from source, ensuring that it's compiled with the correct version of SDL. You can find pygame's source code on its official website and follow the installation instructions there.

Check your system's SDL version: Ensure that you have SDL version 2.28.2 installed on your system. If it's not installed or if there are multiple versions installed, you might want to clean up your SDL installations and ensure that only the required version is present.

one of those will probably work

@santa-69 i like what you did there with the little cmd + c, cmd + v from the trusty dusty bots of the world, AI.

@santa-69 i like what you did there with the little cmd + c, cmd + v from the trusty dusty bots of the world, AI.

Haha, it probably worked tho