目录

一、报错发生

二、报错原因

三、解决方法

一、报错发生

最近把Python升级到了3.11,重新下载了一些模块,但下载安装pygame的时候发生了如下报错:

This error originates from a subprocess, and is likely not a problem with pip. 

详细报错内容:

error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.

│ exit code: 1

╰─> [77 lines of output]

...

...

[end of output]

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

error: metadata-generation-failed

╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

hint: See above for details.

二、报错原因

之前下载pygame的时候是没有发生如上情况的,但当时用的Python版本是3.5、3.10,所以猜想是pygame版本不兼容的问题。

输入 pip install pygame== 查看pygame的版本信息。输出:

ERROR: Could not find a version that satisfies the requirement pygame==

(from versions: 1.9.2rc1, 1.9.2, 1.9.3, 1.9.4.dev0, 1.9.4rc1,ev20,

2.0.0.dev22, 2.0.0.dev24, 2.0.0, 2.0.1.dev1, 2.0.1, 2.0.2.dev4, 2.0.2,

2.0.3.dev2, 2.0.3.dev4, 2.0.3.dev6, 2.0.3, 2.1.0.dev2, 2.1.0, 2.1.1.dev2,

2.1.1.dev4, 2.1.1, 2.1.2, 2.1.3.dev2, 2.1.3.dev4, 2.1.3.dev6, 2.1.3.dev8)

ERROR: No matching distribution found for pygame==

pip默认下载最新的正式版2.1.2,但这个版本最高支持Python3.10。

所以我们输入指令 pip install pygame==2.1.3.dev8 下载最新测试版。 最终下载成功:

Successfully installed pygame-2.1.3.dev8

三、解决方法

· 下载模块时尝试下载较新的版本,以避免不兼容的情况发生

如果对你有帮助的话,就支持一下吧~

精彩链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: