I have installed pygame using pip3 install pygame
command for my python3, but my progam couldn't find it when I imported the module.
Traceback (most recent call last):
File "/Users/zhuoyangmeng/Desktop/Alien_Invasion/alien_invasion.py", line 2, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
I checked the locations of my python3, pygame, and pip3, which are shown below.
pip3 show pygame
Name: pygame
Version: 2.1.2
Summary: Python Game Development
Home-page: https://www.pygame.org
Author: A community project.
Author-email: pygame@pygame.org
License: LGPL
Location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
Requires:
Required-by:
which python3
/usr/local/bin/python3
which pip3
/usr/local/bin/pip3
I'm always confused by python installation path related issues and I have no idea what's going on here. Any help is appreciated!