Python modules issue

Hi, community! I have an issue here, I'm trying to run some python scripts and unfortunately, they are not working. I'm receiving an error message that the module is not present. But after checking for those modules, everything is installed. I have a Macbook pro 16, 2019 running 13.2.1 (22D68) with M1 chip

Currently, as an example let's take pygame module

When I try to run my python code, I'm getting:

ModuleNotFoundError: No module named 'pygame'

But when I'm trying to install the module, I'm getting the following:

Requirement already satisfied: pygame in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (2.1.3)

The same message with pip and pip3

Here is the information that I see when checking for the path for python.

python --version && which python
Python 3.11.2
python: aliased to /usr/local/bin/python3
python3 --version && which python
Python 3.11.2
python: aliased to /usr/local/bin/python3

Any ideas on how to fix that? Tank you in advance

Python modules issue
 
 
Q