python - 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)。
这可能是我的硬件问题吗?
解决方案
推荐阅读
- javascript - Alexa Skill/Lambda 不会记录请求正文
- if-statement - Nginx 有条件地更改请求标头值
- c++ - Mac OS 上 CLion 中的新 Vulkan 项目不会创建 VkInstance
- javascript - Flask 和 JQuery - Safari 不会注册 JQuery 所做的任何操作
- sockets - 无法通过 LwIP 在 STM32F746 UDP 套接字上接收数据
- c# - 通过正则表达式获取匹配的子字符串
- java - yml配置中的Spring Boot Spring EL
- datafeed - 如何从单个 DF 创建新的问卷-目标记录对?
- xamarin.android - Xamarin.Android 中的测试订阅始终处于付款挂起状态
- php - 两个数组的条件融合