-2

我是 Python 的新手,正在尝试使用 eyed3 模块。这是我的代码。

import eyed3

def GetAlbumName(filename):
    tag = eyed3.tag()

我遇到了异常

Exception has occurred: ImportError failed to find libmagic

如以下链接中所述,我安装了“python-magic”,但异常仍然存在。 pip 安装 eyeD3 模块。找不到 libmagic

在 Visual Studio Code 中,我尝试更改解释器(Ctrl+Shift+P),但这也无济于事

4

1 回答 1

0

在 Windows 上

运行pip install python-magic-bin以导入 libmagic 所需的 DLL。


在 OSX 上

brew install libmagic如果您使用自制软件或port install file使用 macport,请运行


它都包含在 python-magic repo https://github.com/ahupp/python-magic的安装部分

于 2019-01-07T22:39:16.400 回答