Pygame 安装在 windows 上,得到“pygame.error: Failed loading libwebp-7.dll";尝试调用 pygame.image.load() 时 [英] Pygame installed on windows, getting "pygame.error: Failed loading libwebp-7.dll" when trying to call pygame.image.load()

查看:256
本文介绍了Pygame 安装在 windows 上,得到“pygame.error: Failed loading libwebp-7.dll";尝试调用 pygame.image.load() 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 10 机器上运行了 python 3.9.1.我通过 pip 在我的机器上安装了 pygame 2.0.1

I've got python 3.9.1 running on a windows 10 machine. I have pygame 2.0.1 installed on my machine via pip

(python -m pip install https://github.com/pygame/pygame/releases/download/2.0.1/pygame-2.0.1-cp39-cp39-win_amd64.whl)

但是在调用 pygame.image.load("file.png") 时出现错误:

however on calling pygame.image.load("file.png") I get the error:

pygame.error: Failed loading libwebp-7.dll: The specified module could not be found.

我尝试通过 pip install pygame 安装并在 pygame.tests 中运行测试,但它们运行良好.

I've tried installing through pip install pygame and running the tests in pygame.tests but they run fine.

推荐答案

我设法通过使用 whl 文件修复了这个错误https://www.lfd.uci.edu/~gohlke/pythonlibs/#游戏而不是来自 github 版本.我不确定这为什么会奏效,但我希望其他遇到此问题的人对此有所帮助.

I managed to fix this error by using the whl file at https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame rather than from the github releases. I'm not sure why this worked, but I hope anyone else having this issue is helped by this.

这篇关于Pygame 安装在 windows 上,得到“pygame.error: Failed loading libwebp-7.dll";尝试调用 pygame.image.load() 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆