当尝试从animation
导入matplotlib
时,我们不断遇到以下错误:
PermissionError:[Errno 13]权限被拒绝:'convert'
这是完整的日志:
$ python
Python 3.7.4 (default, Aug 13 2019, 15:17:50)
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from matplotlib import animation
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/animation.py", line 737, in <module>
class ImageMagickWriter(ImageMagickBase, MovieWriter):
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/animation.py", line 120, in wrapper
if writerClass.isAvailable():
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/animation.py", line 730, in isAvailable
return super().isAvailable()
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/animation.py", line 427, in isAvailable
return shutil.which(cls.bin_path()) is not None
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/animation.py", line 724, in bin_path
binpath = mpl._get_executable_info('magick').executable
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/__init__.py", line 384, in _get_executable_info
return impl([path, "--version"], r"^Version: ImageMagick (\S*)")
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/site-packages/matplotlib/__init__.py", line 324, in impl
args, stderr=subprocess.STDOUT, universal_newlines=True)
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/Users/ssy/miniconda3/envs/bao/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'convert'
任何人都知道为什么以及如何解决这个问题?
我们正在使用conda
来管理环境。其他软件包都可以正常工作。例如
>>> import numpy
>>> import matplotlib
>>> from numpy import arange
这些都很好。