#๐Ÿ”’ ModuleNotFoundError: No module named 'pygame'

31 messages ยท Page 1 of 1 (latest)

next notchBOT
#

@ancient flame

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

tender steppe
#

How are you running your file to get this error? Via "Run" in vsc/PyCharm or manually?

Do you have a venv or .venv folder in your project directory?

ancient flame
tender steppe
#

Okay.
How are you pip installing - what command did you use?

ancient flame
#

pip install

tender steppe
#

When you use just pip, it may be that it's pip from other python version than the one you're running your file with
Please do pip --version

ancient flame
#

pip 25.0.1 from C:\Users\Alejandro\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pip (python 3.12)

tender steppe
#

Hmmm...
In the idle please run

import sys

print(sys.executable)
ancient flame
#

C:\Users\Alejandro\AppData\Local\Programs\Python\Python312\pythonw.exe

tender steppe
#

Huh. Looks like you have two 3.12 pythons next to each other.
Weird.

Since it's windows, please also do py -0p - let's see all versions it can recognise

#

^that command in cmd/powershell, not idle, of course

ancient flame
#

-V:3.12 * C:\Users\Alejandro\AppData\Local\Programs\Python\Python312\python.exe

trail willow
#

maybe the package path isnt on PATH

tender steppe
ancient flame
#

i have to uninstall one right?

tender steppe
ancient flame
#

ok, i will try

tender steppe
#

When reinstalling, use the installer downloaded from python.org, do not try to install from Microsoft Store

ancient flame
#

ok

#

i have installed python from python.org but the error remains the same

#

@

#

@tender steppe

tender steppe
#

Also, pygame-ce is recommended over just pygame. Imports stay the same, just pip command changes to py -m pip install pygame-ce

#

CE version is a fork of the original, but is updated more

ancient flame
#

It works perfectly, thank you so much

next notchBOT
#

:warning: The owner of this post is no longer in the server.

next notchBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.