0

I am trying to get pydub package to work. I installed pydub and ffmpeg. When I run my code:

from pydub import AudioSegment
sound = AudioSegment.from_mp3('Q001007.mp3') 

I get the following error:

> OSError: [WinError 740] The requested operation requires elevation

I am not sure how to solve this error or why it is happening. I checked a solution in another post Request UAC elevation from within a Python script? but the solution there did not work. Is there an easier way to get pydub to work?

ASE
  • 1,702
  • 2
  • 21
  • 29
  • What you tried to do to elevate permissions doesn't make any sense in this case. It's code that would be used to run some other script: it will not continue to execute the rest of your code in the manner you expect (this is why just copy/pasting stuff without understanding it is dangerous). I don't know what pydub is trying to do that requires elevated permissions, but you probably got a traceback and it would help if you instead posted the full traceback. – Iguananaut Apr 28 '19 at 20:26

1 Answers1

0

To get Pydub to work on Windows:

(1) Install pydub

(2) Install ffmpeg following the instruction in this video to add ffmpeg to your path.

(3) If ffmpeg has an administrator permission, remove it by right clicking on each exe file in ffmpeg\bin; and select Properties; and from Compatibility make sure that Run the program as administrator is not selected.

(4) Then restart your computer. This is a very important step.

ASE
  • 1,702
  • 2
  • 21
  • 29