Python:让Pydub使用OSError:[Errno 2]没有这样的文件或目录和OSError:[WinError 740]错误

问题描述 投票:0回答:1

我想让pydub包上班。我安装了pydubffmpeg。当我运行我的代码时:

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工作?

python windows pydub
1个回答
0
投票

要让Pydub在Windows上运行:

(1)安装pydub

(2)按照ffmpeg中的说明安装this video,将ffmpeg添加到您的路径中。

(3)如果ffmpeg拥有管理员权限,请点击exe中的每个ffmpeg\bin文件将其删除;并选择Properties;从Compatibility确保没有选择Run the program as administrator

(4)然后重新启动计算机。这是非常重要的一步。

© www.soinside.com 2019 - 2024. All rights reserved.