Math_Guy
Math_Guy

Reputation: 3

Unable to use pygame in VSCode

I'm currently working on an assignment where I had to complete a few functions and import pygame so I could run a runner program. When I try to import pygame by running the command pip3 install -r requirements.txt (there is a requirements text file that just says pygame in it), it says that it successfully installed it but it also gives a warning that I am not using the latest version of pip. When I run the runner program, it however gives a moduleNotFoundError.

Is there something wrong with the way I am importing pygame or is there something else I am doing wrong?

Upvotes: 0

Views: 668

Answers (2)

redystum
redystum

Reputation: 364

Try update pip:

python -m pip install --upgrade pip

then re-install the package:

pip3 uninstall pygame
python3 -m pip install -U pygame or pip3 install pygame

It should work, otherwise I don't know...

Upvotes: 0

SAM Acc
SAM Acc

Reputation: 48

I had this happen to me once with pyautogui so basically what was happening is that I was using the wrong version of python In cmd it was using pip install for python version 3.9 while on VSCode I was using python 3.10 so if you wanna check what version of python you are installing to in cmd just type python in cmd and it will show the version and compare it with VSCode if they are the same it will work And for the pip install version alert don't worry even if you are running an old version it will still do the job and install everything and this won't affect the installation

Upvotes: 1

Related Questions