pygame error: “ImportError: No module named 'pygame'”

前端 未结 6 1747
情歌与酒
情歌与酒 2021-01-18 02:25

This is my situation:

\"enter

I tried importing pygame in both py

6条回答
  •  萌比男神i
    2021-01-18 03:09

    Edit - pygame only works in python >= 3.6.*

    If you are using Windows i had the same problem and i know how to fix it, follow the steps:

    1. Go to the pygame website, then go to the downloads page
    2. Once there scroll down to the windows section and copy the bit that it says to put into pip It should start with py
    3. Once this short piece of code is copied, open command prompt (search it on start, it is nothing to do with python)
    4. Open it and paste the line of code, it should say downloading and then installing and just wait a bit for it to finish. Then in the command prompt paste the example.aliens thing in and it should work.
    5. Now the complicated part, open file explorer, go to this pc and search pygame once it has fully loaded, look near the top if the list of things it came up with. There should be 2 thing that are called pygame.
    6. Now leave this open and hold the windows button and press r
    7. Then type %appdata% and press enter
    8. This will open the appdata roming file

      Look at the bit at the top that says Appdata > roaming and click on app data

    9. Then click local, then programs, then python, then python36 then go to scripts
    10. Now go back to the pygame search. Click and drag the 2nd thing called pygame into the scripts folder and you should be good to go.

    Pls comment if this doesnt make sense or you would like further details

提交回复
热议问题