You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Pygame 2.1.3.dev8图形绘制尺寸异常问题求助

Pygame 2.1.3.dev8(Python 3.11)图形绘制功能异常问题
  • 环境说明:使用Python 3.11,因正式版Pygame暂不支持该版本,通过命令 pip3 install pygame --pre 安装了预发布版Pygame 2.1.3.dev8
  • 问题表现:Pygame其他功能正常,但所有图形绘制功能均异常。运行测试代码后,输出的矩形宽高均为0,其他绘制功能也出现类似问题
  • 测试代码:
import pygame

pygame.init()
screen = pygame.display.set_mode((600, 600))
pygame.display.set_caption('Title')
tpm = pygame.draw.rect(screen, (0, 0, 0), pygame.Rect(700, 1000, 64, 64), 0)
print(tpm)
pygame.quit()
  • 输出结果:<rect(700, 1000, 0, 0)>
  • 额外限制:无法安装其他版本的Pygame,安装时会触发以下错误:
error: subprocess-exited-with-error

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

内容的提问来源于stack exchange,提问作者Anthony Massaad

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.09 22:35:09