1

I am trying to install pygame on my computer through the command pip install pygame but it is giving me this error:

C:\Users\username>pip install pygame
Collecting pygame
  Using cached pygame-1.9.6.tar.gz (3.2 MB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-8c4rjm0d\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-8c4rjm0d\\pygame\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-88z2lqy5'
         cwd: C:\Users\username\AppData\Local\Temp\pip-install-8c4rjm0d\pygame\
    Complete output (17 lines):


    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using WINDOWS configuration...


    Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\username\AppData\Local\Temp\pip-install-8c4rjm0d\pygame\setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "C:\Users\username\AppData\Local\Temp\pip-install-8c4rjm0d\pygame\buildconfig\config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "C:\Users\username\AppData\Local\Temp\pip-install-8c4rjm0d\pygame\buildconfig\config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "C:\Users\username\AppData\Local\Temp\pip-install-8c4rjm0d\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
        reply = raw_input(
    EOFError: EOF when reading a line
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Is there any way I can fix this?

Zeke Bek
  • 75
  • 4
  • 2
    which version of python are you using? – Andrew Nic Oct 20 '20 at 21:48
  • 1
    Please post the output of `pip --version` and `c:\python\python.exe --version`. – 0x5453 Oct 20 '20 at 21:54
  • @Rabbid76 *none* of the linked answers will work for the original poster as they refer to old development versions of pygame 2 that will also *not* work with Python 3.9. None of the answers linked suggest using the `--pre` argument to pip to grab the latest pre-release version that would render version chasing redundant. – import random Oct 25 '20 at 12:37
  • 1
    @importrandom Anyway similar question are asked over and over again. Fell free to add another duplicate question. There can be linked up to 4 duplicates. If you don't have the reputation to update the duplicates, I'll do it for you. Suggestions? I've add one of your answers – Rabbid76 Oct 25 '20 at 12:51

1 Answers1

1

Currently, Pygame does not support Python 3.9. I know the below commands have worked for some people.

pip install pipwin
pipwin install pygame
KetZoomer
  • 2,701
  • 3
  • 15
  • 43