You are not logged in.

#1 2023-10-04 14:27:36

flyingpenguin
Member
Registered: 2023-10-04
Posts: 7

No module named 'pygame' - installed "python" and "python-pygame"

On two separate Arch machines I can install packages python and python-pygame and still get the following error:

[mark@kramdesktop ~]$ python
Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pygame'
>>> 

I checked, and verified that python-pygame depends on python, so I assume that this is the pygame made for python3, which is default now.

What am I missing?

Offline

#2 2023-10-04 14:38:19

loqs
Member
Registered: 2014-03-06
Posts: 18,929

Re: No module named 'pygame' - installed "python" and "python-pygame"

Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] on linux

If you performa full system update to python-pygame 2.4.0-1/python 3.11.5-2 can you still reproduce the issue?

Offline

#3 2023-10-04 18:06:31

flyingpenguin
Member
Registered: 2023-10-04
Posts: 7

Re: No module named 'pygame' - installed "python" and "python-pygame"

loqs wrote:
Python 3.10.8 (main, Nov  1 2022, 14:18:21) [GCC 12.2.0] on linux

If you performa full system update to python-pygame 2.4.0-1/python 3.11.5-2 can you still reproduce the issue?

A full system upgrade solved it! Thank you! smile Can you explain to me why this helped?

Offline

#4 2023-10-04 18:14:47

loqs
Member
Registered: 2014-03-06
Posts: 18,929

Re: No module named 'pygame' - installed "python" and "python-pygame"

python-pygame 2.4.0-1 (you did not provide the version/release) is built for python 3.11 while your system had python 3.10 installed (which is not the the current version/release) possibly due to a partial upgrade.

Offline

Board footer

Powered by FluxBB