I'm reading the book "Python Crash Course" and I'm following along with the project alien invasion. I installed Python and the package Pygame as the book shows it.
When I run my code I get a ModuleNotFoundError:
ModuleNotFoundError: No module named 'pygame'
[Finished in 0.0s with exit code 1]
[cmd: ['python3', '-u', '/Users/antonio_spatuzzi/Documents/python_work/alien_invasion/alien_invasion.py']]
[dir: /Users/antonio_spatuzzi/Documents/python_work/alien_invasion]
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
even though the package has been successfully installed:
``Requirement already satisfied: pygame in ./.local/lib/python3.8/site-packages (2.0.1)```
How can I solve this problem?