【问题标题】:Getting error about ImageMagick With Python/MoviePy when I try add text clip当我尝试添加文本剪辑时,使用 Python/MoviePy 获取有关 ImageMagick 的错误
【发布时间】:2020-12-04 01:28:51
【问题描述】:

我正在使用python 3.8.5以及最新版本的imagemagick和moviepy

错误(与代码):

Traceback (most recent call last):
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\site-packages\moviepy\video\VideoClip.py", line 1137, in __init__
    subprocess_call(cmd, logger=None)
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\site-packages\moviepy\tools.py", line 46, in subprocess_call     
    proc = sp.Popen(cmd, **popen_params)
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/edgib102/source/repos/Reddit-tts-video/Python/GetComments.py", line 40, in <module>
    TextClip = TextClip('TextTxt', fontsize=100, color = 'white')
  File "C:\Users\edgib102\AppData\Local\Programs\Python\Python38-32\lib\site-packages\moviepy\video\VideoClip.py", line 1146, in __init__
    raise IOError(error)
OSError: MoviePy Error: creation of None failed because of the following error:

[WinError 2] The system cannot find the file specified.

.This error can be due to the fact that ImageMagick is not installed on your computer, or (for Windows users) that you didn't specify the path to the ImageMagick binary in file conf.py, or that the path you specified is incorrect

代码:

TextClip = TextClip('TextTxt', fontsize=100, color = 'white')
TextClip = TextClip.set_position('center').set_duration(10)

非常感谢任何帮助,以及完整代码here

【问题讨论】:

  • 您安装的是 ImageMagick 6 还是 7? MoviePy 可能需要 IM 6,也可能需要 IM 7,但您安装了错误的版本。在 Windows 上,要获得 IM 6,我相信您需要从安装窗口安装旧版组件。
  • 我查了一下,是 IM 7。那么我需要 IM 6 吗?
  • @Eden Gibson 检查 MoviePy 的要求。但这似乎很有可能。

标签: python-3.x file video imagemagick moviepy


【解决方案1】:

解决了。只需要将magick.exe 文件路径设置为default_config.py 中的变量。你可以在moviepy文件夹中找到它。

【讨论】:

  • 你的意思是哪个default_config.py?请问您可以通过显示添加的代码行来提供完整的解决方案吗?
猜你喜欢
  • 2023-03-29
  • 2018-07-12
  • 1970-01-01
  • 2014-07-28
  • 2011-11-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-01-21
相关资源
最近更新 更多