python如何用pip安装pygame_通过pip安装pygame

在尝试使用pip安装pygame时遇到了错误。在C:UsersMatthew>pip install pygame后,虽然开始下载,但在运行python setup.py egg_info时出现警告,提示SDL路径未找到等依赖库问题。错误提示可能需要手动修复'Setup'文件,建议检查compiler flags并确保所有必需库已正确配置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我试图通过pip安装pygame来使用pygame,但是当我使用命令pip install pygame时,它开始工作,直到抛出错误为止,它看起来还不错。这是我得到的输出,我不确定我是否做的正确或什么,我是新的pip,所以我不确定。任何帮助都将不胜感激!在C:\Users\Matthew>pip install pygame

Collecting pygame

Using cached pygame-1.9.2.tar.gz

Complete output from command python setup.py egg_info:

WARNING, No "Setup" File Exists, Running "config.py"

Using WINDOWS configuration...

Path for SDL not found.

Too bad that is a requirement! Hand-fix the "Setup"

Path for FONT not found.

Path for IMAGE not found.

Path for MIXER not found.

Path for PNG not found.

Path for JPEG not found.

Path for PORTMIDI not found.

Path for COPYLIB_tiff not found.

Path for COPYLIB_z not found.

Path for COPYLIB_vorbis not found.

Path for COPYLIB_ogg not found.

If you get compiler errors during install, doublecheck

the compiler flags in the "Setup" file.

Continuing With "setup.py"

Error with the "Setup" file,

perhaps make a clean copy from "Setup.in".

Traceback (most recent call last):

File "", line 1, in

File "C:\Users\Matthew\AppData\Local\Temp\pip-build-kzk4_t2_\pygame\setup.

py", line 165, in

extensions = read_setup_file('Setup')

File "c:\users\matthew\appdata\local\programs\python\python36-32\lib\distu

tils\extension.py", line 171, in read_setup_file

line = expand_makefile_vars(line, vars)

File "c:\users\matthew\appdata\local\programs\python\python36-32\lib\distu

tils\sysconfig.py", line 410, in expand_makefile_vars

s = s[0:beg] + vars.get(m.group(1)) + s[end:]

TypeError: must be str, not NoneType

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Matthew\

AppData\Local\Temp\pip-build-kzk4_t2_\pygame\

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值