0

I'm trying to use the library pydub, but when I run the script i get this.

runfile('E:/OneDrive - usach.cl/chillbot/pydub.py', wdir='E:/OneDrive - usach.cl/chillbot')
Traceback (most recent call last):

  File "<ipython-input-203-a38a65fe4502>", line 1, in <module>
    runfile('E:/OneDrive - usach.cl/chillbot/pydub.py', wdir='E:/OneDrive - usach.cl/chillbot')

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
    execfile(filename, namespace)

  File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "E:/OneDrive - usach.cl/chillbot/pydub.py", line 9, in <module>
    from pydub import AudioSegment

  File "E:\OneDrive - usach.cl\chillbot\pydub.py", line 9, in <module>
    from pydub import AudioSegment

ImportError: cannot import name 'AudioSegment'

I don't find information about the error, I'm using windows 10 with anaconda, the code that I'm running is.

from pydub import AudioSegment
AudioSegment.ffmpeg = "C:\ffmpeg\bin"

song = AudioSegment.from_mp3("I_eat_Plants_for_a_living-Unfaithful.mp3")

If I delete all the code except from pydub import AudioSegment I get the same error.

SergioSalinas
  • 115
  • 1
  • 2
  • 11

1 Answers1

2

Having a file named pydub.py is a red flag. Try renaming it?

Ossama
  • 2,401
  • 7
  • 46
  • 83