首页 > 解决方案 > pygame.init() 不工作。错误:pygame.error:视频系统未初始化

问题描述

我正在尝试在我的 Windows 10 上安装 pygame,并且我使用的是 python 3.6.7。我为我的项目创建了一个虚拟环境并用于python3 -m pip install -U pygame --user安装包(版本 1.9.4)。我收到了该软件包已正确安装的消息,但是当我对其进行测试时,python3 -m pygame.examples.aliens我收到了该消息pygame.error: video system not initialized

此外,当我pygame.init()在命令行中运行时,我收到的是 (4,2) 而不是 (6,0)。

这可能是我的硬件问题吗?

标签: pythonpython-3.xpygame

解决方案


推荐阅读