OSError: [Errno 86] Bad CPU type in executable: ‘convert’ on import matplotlib.animation

Bug report

Bug summary

import matplotlib.animation as animation crashes with error on macOS Catalina:

OSError: [Errno 86] Bad CPU type in executable: ‘convert’

Code for reproduction

import matplotlib.animation as animation

Actual outcome

(python36) d-i184-9-160:~ alina$ python
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 13:42:17) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.animation as animation
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/animation.py", line 737, in <module>
    class ImageMagickWriter(ImageMagickBase, MovieWriter):
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/animation.py", line 120, in wrapper
    if writerClass.isAvailable():
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/animation.py", line 730, in isAvailable
    return super().isAvailable()
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/animation.py", line 427, in isAvailable
    return shutil.which(cls.bin_path()) is not None
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/animation.py", line 724, in bin_path
    binpath = mpl._get_executable_info('magick').executable
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/__init__.py", line 384, in _get_executable_info
    return impl([path, "--version"], r"^Version: ImageMagick (\S*)")
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/site-packages/matplotlib/__init__.py", line 324, in impl
    args, stderr=subprocess.STDOUT, universal_newlines=True)
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 356, in check_output
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/Users/alina/anaconda3/envs/python36/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: 'convert'

Expected outcome
Expect to load library with no error.

Matplotlib version

  • Operating system: Latest Mac version (likely the culprit) — MacOS Catalina V10.15
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): MacOSX
  • Python version: Python 3.7.3 & Python 3.6.9 :: Anaconda, Inc.
  • Jupyter version (if applicable): N/A
  • Other libraries:

Matplotlib was installed using conda default channel

1 possible answer(s) on “OSError: [Errno 86] Bad CPU type in executable: ‘convert’ on import matplotlib.animation