Unable to import pygame even though it should be installed

Viewed 37

So I'm trying to install pygame using pip and then I'm trying to import pygame(using vscode by the way) but when I try to import it I get:

ModuleNotFoundError: No module named 'pygame'

Doing python --version in the vscode terminal outputs that my python version is Python 3.10.6 and when I do pip list it does show that pygame 2.1.2 is indeed installed. What am I doing wrong here?

1 Answers

You can install a module for a specific python version: python3.10.6 -m pip install pygame

But this command will probably throw an error, because pygame doesn't support python versions above 3.9.5 yet, so you have to use an older version or wait for a the next pygame release.

Related