pip install pygame安装报错解决方案

针对pip install pygame安装报错的两种不同的解决方法:

一:若python中已经安装好了pip,但pip install pygame却报错的话,可以尝试以下步骤:

(1)开始,输入cmd

(2)pip install wheel

(3)pip install pygame

二:另一种出现错误的原因是版本问题,此时下载pygame会出现以下警告: 

ERROR: Could not find a version that satisfies the requirement pygeme (from versions: none)
ERROR: No matching distribution found for pygeme
WARNING: You are using pip version 21.2.4; however, version 23.1 is available.
You should consider upgrading via the 'C:UsersjihAppDataLocalProgramsPythonPython310python.exe -m pip install --upgrade pip' command.

针对这种问题,我们只需要把警告引号里面的内容复制下来就可以了,即:

C:UsersjihAppDataLocalProgramsPythonPython310python.exe -m pip install --upgrade pip

最后,我们就可以成功安装pygame了: