Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Davut-A opened this issue Sep 17, 2023 · 3 comments
Open

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

Davut-A opened this issue Sep 17, 2023 · 3 comments

Comments

@Davut-A
Copy link

Davut-A commented Sep 17, 2023

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!

@santa-69
Copy link

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

@sudoForRoot
Copy link

@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
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants