Error during package installation

I tried to install “pygame” via the command line and got this:

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

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

      WARNING, No "Setup" File Exists, Running "buildconfig/"
      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\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\", line 359, in <module>
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 225, in main
          deps = CFG.main(**kwds)
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 497, in main
          and download_win_prebuilt.ask(**download_kwargs):
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 290, in ask
          update(x86=x86, x64=x64)
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 273, in update
          download_prebuilts(download_dir, x86=x86, x64=x64)
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 124, in download_prebuilts
          download_sha1_unzip(url, checksum, temp_dir, 1)
        File "C:\Users\alfgo\AppData\Local\Temp\pip-install-o791o83x\pygame_dd33c4503bfb40709aff74ffd6ac1c00\buildconfig\", line 54, in download_sha1_unzip
          response = urllib.urlopen(request).read()
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 216, in urlopen
          return, data, timeout)
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 525, in open
          response = meth(req, response)
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 634, in http_response
          response = self.parent.error(
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 563, in error
          return self._call_chain(*args)
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 496, in _call_chain
          result = func(*args)
        File "C:\Users\alfgo\AppData\Local\Programs\Python\Python311\Lib\urllib\", line 643, in http_error_default
          raise HTTPError(req.full_url, code, msg, hdrs, fp)
      urllib.error.HTTPError: HTTP Error 403: Forbidden
      Making dir :prebuilt_downloads:
      Downloading... ed561079ec622b0bab5a9e02976f5d540b0622da
      Unzipping :prebuilt_downloads\
      Downloading... 137f86474691f4e12e76e07d58d5920c8d844d5b
      Unzipping :prebuilt_downloads\
      Downloading... 1436df41ebc47ac36e02ec9bda5699e80ff9bd27
      Unzipping :prebuilt_downloads\
      Downloading... 9097148f4529cf19f805ccd007618dec280f0ecc
      Unzipping :prebuilt_downloads\
      Downloading... ed10aa2b5a0fcfe74f8a6f7611aeb346b06a1f99

      For help with compilation see:

      To contribute to pygame development see:


      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Pip and setuptools have the latest version.
I also tried “pip3 to install pygame”, but ended up with the same error. The command line was launched in the administration mode. I tried to install via pycharm and anaconda, an error also occurred.
I tried to use the official troubleshooting and some other solutions from the discussion with a similar problem, nothing worked. I’m new to python and programming, so I have no idea what the problem is. If you know how to fix it, please answer.

Try using python 3.10 until the pygame developers have a release for 3.1a.