如何修复visual studio代码中DLL加载失败的问题?

2024-09-30 00:40:18 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试导入pygame时,我遇到了一个错误

visual studio代码显示的错误如下:

from pygame.base import * # pylint: disable=wildcard-import; lgtm[py/polluting-import]
Import error: DLL load failed while importing base: The specified procedure could not be found

其他信息: 我已经安装了pywin32和pypiwin32

python版本3.9

visual studio代码版本1.51


Tags: 代码frompyimport版本base错误pygame
1条回答
网友
1楼 · 发布于 2024-09-30 00:40:18

请检查您当前使用的Python是否与安装的pygame相同(都是64位或32位)

建议您在python3.9环境中重新安装模块“pygame”:pip3 install pygame==2.0.0 python==3.9

我正在使用python3.9(64)、pygame2.0.0:

enter image description here

相关问题 更多 >

    热门问题