1

I am trying to make a simple python game using pygame. i installed it using "pip install pygame" when i type it into command prompt now it says "Requirement already satisfied". However when i run my python script inside of the python 3.9.6 IDLE shell i get the following error message

ModuleNotFoundError: No module named 'pygame'

I have installed many other libraries before and they have worked fine until i got pygame. Does anyone know what i could do fix this?

  • 3
    You have more than one version of python installed on your system. pygame was installed for one version, but IDLE is using a different version. Show us the output of this command: `pip --version` and also this code in IDLE: `import sys; print(sys.version)` – John Gordon Aug 05 '21 at 03:11
  • @JohnGordon Thank you for helping me. when i use pip --version in the command terminal it says "pip 21.2.2 from C:\Users\liam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pip (python 3.9)" when i run "import sys; print(sys.version)" in IDLE i get "3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:26:21) [MSC v.1929 64 bit (AMD64)]" – mojochicken Aug 05 '21 at 17:01
  • Well, those both point to Python 3.9, so I'm not sure what the problem is. – John Gordon Aug 05 '21 at 17:39
  • The site-packages path given from the `pip` command does not look like a standard path. Do you have pip installed in a virtual environment? – John Gordon Aug 05 '21 at 18:56

0 Answers0