1

I was trying to install pygame for python 3.11.1 and using the command would just give this message:

C:\Users\Admin>py -m pip install pygame
Collecting pygame
  Using cached pygame-2.1.2.tar.gz (10.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [63 lines of output]


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

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\setup.py", line 359, in <module>
          buildconfig.config.main(AUTO_CONFIG)
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\config.py", line 225, in main
          deps = CFG.main(**kwds)
                 ^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\config_win.py", line 497, in main
          and download_win_prebuilt.ask(**download_kwargs):
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\download_win_prebuilt.py", line 290, in ask
          update(x86=x86, x64=x64)
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\download_win_prebuilt.py", line 273, in update
          download_prebuilts(download_dir, x86=x86, x64=x64)
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\download_win_prebuilt.py", line 124, in download_prebuilts
          download_sha1_unzip(url, checksum, temp_dir, 1)
        File "C:\Users\Admin\AppData\Local\Temp\pip-install-hwg_jwt7\pygame_2b7185b403a54d94b369085ebaaea97c\buildconfig\download_win_prebuilt.py", line 54, in download_sha1_unzip
          response = urllib.urlopen(request).read()
                     ^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 519, in open
          response = self._open(req, data)
                     ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 536, in _open
          result = self._call_chain(self.handle_open, protocol, protocol +
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 496, in _call_chain
          result = func(*args)
                   ^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 1391, in https_open
          return self.do_open(http.client.HTTPSConnection, req,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\urllib\request.py", line 1317, in do_open
          h = http_class(host, timeout=req.timeout, **http_conn_args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\http\client.py", line 1421, in __init__
          context = ssl._create_default_https_context()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 775, in create_default_context
          context.load_default_certs(purpose)
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 596, in load_default_certs
          self._load_windows_store_certs(storename, purpose)
        File "C:\Users\Admin\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 588, in 

_load_windows_store_certs self.load_verify_locations(cadata=certs) ssl.SSLError: not enough data: cadata does not contain a certificate (_ssl.c:3989) Making dir :prebuilt_downloads: Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.18-VC.zip ed561079ec622b0bab5a9e02976f5d540b0622da

  ---
  For help with compilation see:
      https://www.pygame.org/wiki/CompileWindows
  To contribute to pygame development see:
      https://www.pygame.org/contribute.html
  ---

  [end of output]
and when trying the commant to install preversion it would just give me this message

C:\Users\Admin>pip install pygame --pre 'pip' is not recognized as an internal or external command, operable program or batch file.

So if anyone could help?


PS. Tried reinstalling python and it didnt work.
sonikstale
  • 11
  • 2
  • hi, can you try running `python --version` and see if it gives you a `python is not recognized as an internal or external command` error? this will check if python has a working path. – myrccar Jan 25 '23 at 17:03
  • Also like, don't really ever reinstall Python to solve an issue, Python itself is the least likely to be the culprit – Matiiss Jan 25 '23 at 19:21

0 Answers0