首页 > 解决方案 > Python 2.7 导入 libsoundtouch

问题描述

我想安装 libsoundtouch(“pip install libsoundtouch”)。在安装过程之后,一切似乎都是正确的,但是当我运行我的脚本 python(2.7) 可以导入这个模块。检查后我在“/usr/local/lib/python2.7/dist-packages/libsoundtouch”中有文件。

#!/usr/bin/python
# -*- coding: utf-8 -*-
import libsoundtouch

./home/pi/myprog/scripts/python/test.py Traceback(最近一次调用最后):文件“./home/pi/myprog/scripts/python/test.py”,第 5 行,在导入 libsoundtouch 文件“ /usr/local/lib/python2.7/dist-packages/libsoundtouch/init .py”,第 9 行,从 zeroconf 导入 Zeroconf,ServiceBrowser 文件“ /usr/local/lib/python2.7/dist-packages/zeroconf .py",第 189 行 def current_time_millis() -> float: ^ SyntaxError: invalid syntax

标签: python-2.7import

解决方案


推荐阅读