在Python中从Pydub导入AudioSegment的问题

时间:2019-07-11 14:39:10

标签: python pydub audiosegment

我正在尝试将pydub导入到项目中,并出现以下错误:

Traceback (most recent call last): File "wave.py", line 3, in <module> from pydub import AudioSegment File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pydub/__init__.py", line 1, in <module> from .audio_segment import AudioSegment File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pydub/audio_segment.py", line 7, in <module> import wave File "/Users/Sim/Desktop/Audio Wave/wave.py", line 3, in <module> from pydub import AudioSegment ImportError: cannot import name 'AudioSegment'

我安装了pydub时没有任何问题,所以不确定是什么问题。

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

它不喜欢文件名wave.py。给它起个新名字,一切都好。