当我在conda环境中的MacOS Catalina上运行PyCharm中的以下代码时:
import ffmpy
ff = ffmpy.FFmpeg(
inputs={'download/v_5c80f6ac3e28a_7BumyNgu/video.m3u8': ['-protocol_whitelist', 'crypto,file,http,https,tcp,tls']},
outputs={'download/ffmpy_test.mp4': None}
)
print(ff.cmd)
ff.run()
我得到了这个错误:
Traceback (most recent call last):
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/site-packages/ffmpy.py", line 95, in run
stderr=stderr
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myname/Documents/Projects/xiaoetong/ffmpy_test.py", line 8, in <module>
ff.run()
File "/Users/myname/.conda/envs/xiaoetong/lib/python3.7/site-packages/ffmpy.py", line 99, in run
raise FFExecutableNotFoundError("Executable '{0}' not found".format(self.executable))
ffmpy.FFExecutableNotFoundError: Executable 'ffmpeg' not found
Process finished with exit code 1
上面的回溯信息字面上意味着ffmpeg
未安装或命令未添加到路径。然而,我确实安装了它,并且我可以在终端中成功地调用ffmpeg
命令。我甚至可以在完全相同的conda环境中(并使用完全相同的python解释器)在zsh终端中运行该python脚本而不会出错
(一些可能有用的信息:
同样的代码也可以在Windows 10上PyCharm的同一conda环境中无误运行。
python==3.7.5,ffmpeg==4.2,ffmpy==0.2.2)
这个错误太奇怪了,我一点都不知道。请有人帮忙,我会很感激的
目前没有回答
相关问题 更多 >
编程相关推荐