Unable to use package after installing

Viewed 28

I was trying to make a game with pygame so I first tried to install pygame: python3 -m pip install pygame and it returns:

Requirement already satisfied: pygame in c:\users\drcya\scoop\persist\python\lib\site-packages (2.1.2)

so I thought the package was installed and I start running the script, however I received an error:

Traceback (most recent call last): File "c:\Users\drcya\code\python\game\a_0.0.1\main.py", line 3, in <module> import pygame ModuleNotFoundError: No module named 'pygame'

I have checked that I have pygame installed, and if I use python "C:\Users\drcya\code\python\game\a_0.0.1\main.py to run the script, it works just fine. But if I try to run it by the run button in VSCode, it returns the above ModuleNotFoundError and in VSCode, a warning also appears on the line of importing pygame.

0 Answers
Related