0

I already have pygame installed. If I type pip3 install pygame into the terminal it returns requirement already satisfied, which means its already installed. However, if I was to type import pygame, I get this error:

import pygame,sys,random
ImportError: No module named pygame.

Im using VSCode, and the error is probably happening there, as Pygame worked fine in IDLE. Does anyone know what is happening here?

willcrack
  • 1,794
  • 11
  • 20

1 Answers1

2

The problem might be that VSCode is running your code with python not python3 so you will have to install it with pip install pygame or run it from the console by typing python3 mycode.py

MoPaMo
  • 517
  • 6
  • 24