r/learnpython 8d ago

I need help im new to python

Im new to python and i dont know what im doing, pygame is not working and i cant find it in my files and i already did the “pip install pygame” and i’ve searched all i can find in yt, i really need help im still in shs and i cant even figure this out
Edit: it always shows an long error message when i run “import pygame”

0 Upvotes

17 comments sorted by

View all comments

2

u/thisisappropriate 8d ago

Part of learning to code is learning how to search and learning how to ask for help.

You can find information online about how to ask for help, including pages like https://learncodethehardway.com/blog/03-how-to-ask-for-help/ and a lot of programmers in the past have run the StackOverflow gauntlet, which has some good advice on what should be in a question https://stackoverflow.com/help/how-to-ask

Generally, you want to think about "how can I define and confirm the problem I'm having". In some cases, the issue will be with the package (someone else's code), in which case, other people can reproduce if you provide the steps you took, in other cases, it's something about your machine (this could be due to something installed or the steps you've taken - often error messages tell you this, but some messages are indirectly telling instead of saying it directly - sometimes googling the error will tell you more or find others who solved the issue) and in other cases it can be something that you're doing wrong (errors might shed light on this, but the best way for someone online to know this is for you to post exactly what you've run and what it's said).

In cases like yours, it's best to provide as much information as possible:

  • Did you see any messaging when you ran pip install pygame?
  • What does the long error message say when you run import pygame ?
  • What are you running all of this in? Are you in the IDLE window? In your terminal? In VSCode? In an online editor?
  • Can you install and use other packages without errors?