我正在尝试从https://pythonprogramming.net/live-graphs-matplotlib-tutorial/运行示例实时图表,该图表以以下内容开头(这是失败源的全文):
import matplotlib.pyplot as plt
import matplotlib.animation as animation
第二次导入失败:
Traceback (most recent call last):
File "example.py", line 2, in <module>
import matplotlib.animation as animation
File "/usr/lib/python3.6/site-packages/matplotlib/animation.py", line 737, in <module>
class ImageMagickWriter(ImageMagickBase, MovieWriter):
File "/usr/lib/python3.6/site-packages/matplotlib/animation.py", line 120, in wrapper
if writerClass.isAvailable():
File "/usr/lib/python3.6/site-packages/matplotlib/animation.py", line 730, in isAvailable
return super().isAvailable()
File "/usr/lib/python3.6/site-packages/matplotlib/animation.py", line 427, in isAvailable
return shutil.which(cls.bin_path()) is not None
File "/usr/lib/python3.6/site-packages/matplotlib/animation.py", line 724, in bin_path
binpath = mpl._get_executable_info('magick').executable
File "/usr/lib/python3.6/site-packages/matplotlib/__init__.py", line 384, in _get_executable_info
return impl([path, "--version"], r"^Version: ImageMagick (\S*)")
File "/usr/lib/python3.6/site-packages/matplotlib/__init__.py", line 329, in impl
raise _cpe
File "/usr/lib/python3.6/site-packages/matplotlib/__init__.py", line 324, in impl
args, stderr=subprocess.STDOUT, universal_newlines=True)
File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['convert', '--version']' returned non-zero exit status 4.
我在Win10上的Cygwin下运行python 3.6。所有Cygwin软件包昨天都已更新或安装。
convert
是Windows程序,用于转换文件系统,并且没有--version
选项(或任何以--
开头的选项。)您知道在这里打算使用什么convert命令吗? / p>