运行pyAudioAnalysis示例程序时出错 [英] Error running the pyAudioAnalysis sample program

查看:54
本文介绍了运行pyAudioAnalysis示例程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 pycharm (linux) 在 python2.7 上安装了 pyAudioAnalysis.尝试运行 audioBasicIO.py 会出现以下错误.我已经安装了 eyeD3 但它不起作用.

I installed pyAudioAnalysis on python2.7 using pycharm (linux). Trying to run audioBasicIO.py gives the following error. I have installed eyeD3 but it does not work.

/usr/bin/python2.7 /usr/local/lib/python2.7/dist-packages/pyAudioAnalysis/audioBasicIO.py
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pyAudioAnalysis/audioBasicIO.py", line 6, in <module>
    import eyed3
  File "/home/.local/lib/python2.7/site-packages/eyed3/__init__.py", line 31, in <module>
    from .utils.log import log                                          # noqa: E402
  File "/home/.local/lib/python2.7/site-packages/eyed3/utils/__init__.py", line 361
    msg = f"invalid level choice: {level} (choose from {parser.log_levels})"
                                                                           ^
SyntaxError: invalid syntax

我的安装不正确吗?这是我第一次使用这个库,有没有人有任何建议.

Is my installation incorrect? This is the first time I use this library, does anyone have any suggestions.

推荐答案

f-string 不支持 python 2.7.您需要 python 3.6 或更高版本才能使用它们.这里是一个很好的解决方法,您可以在python 3.6以下使用f-strings.

f-strings aren't supported for python 2.7. You need python 3.6 or above to use them. Here is a good workaround, in which you can use f-strings in below python 3.6.

这篇关于运行pyAudioAnalysis示例程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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