【发布时间】:2021-01-08 20:26:48
【问题描述】:
我在 2009 年中期的 macbook pro 上安装了 python 3.8.7,但似乎无法在其上正确安装 pygame。我已经进入终端并使用命令“pip3 install pygame”安装它,这似乎工作正常,但是当我尝试在 python 中导入它时出现错误消息“找不到图像”。如果有人可以提供帮助,将不胜感激。
错误堆栈跟踪
Traceback (most recent call last): File "/Users/user/Documents/check.py",
line 1, in <module> import pygame File
"/Users/user/Library/Python/3.8/lib/python/site-packages/pygame/__init__.py",
line 81, in <module> from pygame.base import * # pylint: disable=wildcard-
import; lgtm[py/polluting-import] ImportError:
dlopen(/Users/user/Library/Python/3.8/lib/python/site-
packages/pygame/base.cpython-38-darwin.soLibrary not loaded:
/System/Library/Frameworks/Metal.framework/Versions/A/Metal Referenced from:
/Users/user/Library/Python/3.8/lib/python/site-packages/pygame/base.cpython-
38-darwin.so Reason: image not found
【问题讨论】:
-
我没有尝试加载我刚刚导入 pygame 的图像
-
我不认为这与图像有关,因为我没有尝试导入图像
-
请贴出full错误信息,包括回溯,否则很难查明问题。
-
也许 pygame 没有正确安装。我有一半的问题是通过卸载和重新安装来解决的,所以试试吧。