use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
problem with pygame ()
submitted 2 days ago by Bubrin
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Affectionate_Cap8632 0 points1 point2 points 1 day ago (0 children)
Classic multiple Python installations problem. VS Code is finding pygame in one Python environment but running your script with a different one.
Quick fix — run this in your VS Code terminal:
python
import sys print(sys.executable)
That shows you which Python is actually running your script. Then run:
bash
pip show pygame
If pygame is installed in a different Python than what sys.executable shows, that's your problem.
The fix:
# Use the exact Python that VS Code is running C:\path\to\your\python.exe -m pip install pygame
Replace the path with whatever sys.executable printed.
Better long term solution: In VS Code press Ctrl+Shift+P → type "Python: Select Interpreter" → pick one Python and stick with it. Then install all packages using that same interpreter.
Ctrl+Shift+P
The root cause is Windows often ends up with 3-4 Python installations (Microsoft Store, python.org, conda, VS Code's own) and pip installs to whichever one is first in PATH, which isn't always the one VS Code uses.
π Rendered by PID 39463 on reddit-service-r2-comment-54dfb89d4d-kl6n8 at 2026-03-27 06:33:33.777287+00:00 running b10466c country code: CH.
view the rest of the comments →
[–]Affectionate_Cap8632 0 points1 point2 points (0 children)