代码之家  ›  专栏  ›  技术社区  ›  Anu Viswan

使用eyed3模块时的importorror(libmagic)

  •  -1
  • Anu Viswan  · 技术社区  · 6 年前

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

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

    我遇到了异常情况

    Exception has occurred: ImportError failed to find libmagic
    

    如下面的链接所述,我安装了“python magic”,但仍然存在异常。 pip installing eyeD3 module. Failed to find libmagic

    在Visual Studio代码中,我尝试更改interpeter(Ctrl+Shift+P),但这也没有帮助

    1 回复  |  直到 6 年前
        1
  •  0
  •   Jacob    6 年前

    在Windows上

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


    在OSX上

    brew install libmagic 如果您使用自制或 port install file


    所有这些都包含在python magic repo的安装部分中 https://github.com/ahupp/python-magic