0

I am trying to install pygame in python 3.8, but I am having an error message I can't figure out what's wrong.

I am following a tutorial that used the command pip install pygame within the script folder after installing python, but that doesn't seem to work for me.

Any idea of what I am doing wrong or what I need to do? I am not very good with the systems around python.

C:\Users\KaspArno\AppData\Local\Programs\Python\Python38-32\Scripts>pip install pygame
Collecting pygame
  Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\kasparno\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\KaspArno\\AppData\\Local\\Temp\\pip-install-hntok19u\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\KaspArno\\AppData\\Local\\Temp\\pip-install-hntok19u\\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\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\pip-egg-info'
         cwd: C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\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-x86"? [Y/n]Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\buildconfig\config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\pygame\buildconfig\config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "C:\Users\KaspArno\AppData\Local\Temp\pip-install-hntok19u\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.
RMPR
  • 3,368
  • 4
  • 19
  • 31
  • Can you run python and try to import sys, setuptools, tokenize and tell me the output if it results in an error – Sanil Khurana Oct 31 '19 at 20:27
  • Basically the end of a file listing existing pre-built images of pygame was reached before finding one built for python 3.8. You could conceivably compile pygame yourself, but the far easier solution would be to go back to python 3.7 or earlier. 3.8 only came out a few weeks ago, and libraries will need time to catch up. – Aaron Oct 31 '19 at 20:27
  • @SanilKhurana None of those imports gave me any errors – Kasper Skjeggestad Oct 31 '19 at 22:47
  • @Aaron Thanks, I will try to downgrade to that one and try again – Kasper Skjeggestad Oct 31 '19 at 22:48

1 Answers1

5

The issue is more likely with python 3.8, you need to compile it yourself or use an older version of python (<= 3.7).

RMPR
  • 3,368
  • 4
  • 19
  • 31