You are not logged in.
Pages: 1
so whenever i try to run pygame i get this
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 187, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.10/runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "/home/milfhunter2/test.py", line 2, in <module>
pygame.init()
RuntimeError: SDL compiled with version 2.24.0, linked to 2.0.22Have i messed up my python installation somehow? is there anyway to fix it?
heres the code i am using to test it
import pygame
pygame.init()i love niko oneshot
Offline
Have you *ever* used pip as root ?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Online
Have you *ever* used pip as root ?
Yes, made that mistake before.
any way to fix it?
i love niko oneshot
Offline
Let's go for the low hanging fruit first. Is there anything in ~/.local/lib ? If so, please tell us.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Online
Let's go for the low hanging fruit first. Is there anything in ~/.local/lib ? If so, please tell us.
ls only shows python3.10
i love niko oneshot
Offline
Okay, that directory probably should not be there. what is the output of find ~/.local/lib ?
Hopefully that will not be a huge list.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Online
Okay, that directory probably should not be there. what is the output of find ~/.local/lib ?
Hopefully that will not be a huge list.
it sadly appears to be
https://pastebin.com/WgmYmYRw
i love niko oneshot
Offline
Yeah. You have a fair number of local packages installed which will override system level packages. Python on Arch is, in my humble opinion, imperfect. Me recommend not using pip to install things, but there are times I find it necessary. We prefer to install modules as packages controlled by pacman and available globally.
Personally, I tend to use virtual environments (I am somewhat partial to poetry), and I then install packages I create with pip as user. If you try to install some things using pacman, and others with pip without virtual environments, you are likely to step on your own shoelaces.
Let's try this -- and it may be iterative -- let's remove the local files from the equation. For now
mv ~/.local/lib/python3.10 ~This will move all those files to your $HOME where Python won't find them (BTW, that command assumes there is not a python3.10 directory there already -- check that before you run that command)
Then try to run your program, It will likely fail because of a missing module. Then, we will install modules as we need them.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Online
Make sure your pygame is up to date, you should have 2.1.2-2 on a properly updated mirror. The error in the OP suggest a linking problem with SDL2 not a python dependency issue, and at least in the local files list there's not much with relation to pygame
Last edited by V1del (2022-09-05 15:31:54)
Offline
Yeah. You have a fair number of local packages installed which will override system level packages. Python on Arch is, in my humble opinion, imperfect. Me recommend not using pip to install things, but there are times I find it necessary. We prefer to install modules as packages controlled by pacman and available globally.
Personally, I tend to use virtual environments (I am somewhat partial to poetry), and I then install packages I create with pip as user. If you try to install some things using pacman, and others with pip without virtual environments, you are likely to step on your own shoelaces.
Let's try this -- and it may be iterative -- let's remove the local files from the equation. For now
mv ~/.local/lib/python3.10 ~This will move all those files to your $HOME where Python won't find them (BTW, that command assumes there is not a python3.10 directory there already -- check that before you run that command)
Then try to run your program, It will likely fail because of a missing module. Then, we will install modules as we need them.
running the test code outputs
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/home/milfhunter2/Desktop/Bowie-base-one-main/Code/test.py", line 2, in <module>
pygame.init()
RuntimeError: SDL compiled with version 2.24.0, linked to 2.0.22Running the actual game code outputs
pygame 2.1.2 (SDL 2.0.22, Python 3.10.6)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/home/milfhunter2/Desktop/Bowie-base-one-main/Code/main.py", line 5, in <module>
import screeninfo
ModuleNotFoundError: No module named 'screeninfo'i love niko oneshot
Offline
Pages: 1