我想让pydub
包上班。我安装了pydub
和ffmpeg
。当我运行我的代码时:
from pydub import AudioSegment
sound = AudioSegment.from_mp3('Q001007.mp3')
我收到以下错误:
> OSError: [WinError 740] The requested operation requires elevation
我不知道如何解决这个错误或为什么会发生这种错误。我在另一个帖子Request UAC elevation from within a Python script?检查了一个解决方案,但那里的解决方案没有用。是否有更简单的方法让pydub工作?
要让Pydub在Windows上运行:
(1)安装pydub
(2)按照ffmpeg中的说明安装this video,将ffmpeg
添加到您的路径中。
(3)如果ffmpeg
拥有管理员权限,请点击exe
中的每个ffmpeg\bin
文件将其删除;并选择Properties
;从Compatibility
确保没有选择Run the program as administrator
。
(4)然后重新启动计算机。这是非常重要的一步。