1

When trying to import matplotlib.pyplot (in Spyder), I get the following error(s):

Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 15:01:46) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy as sp
>>> import numpy as np
>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\pyplot.py", line 36, in <module>
    from matplotlib.figure import Figure, figaspect
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\figure.py", line 35, in <module>
    from matplotlib import _image
ImportError: DLL load failed: Operation did not complete successfully because the file contains a virus or potentially unwanted software.

If I try to import it again, I get the following:

>>> import matplotlib.pyplot as plt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\pyplot.py", line 36, in <module>
    from matplotlib.figure import Figure, figaspect
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\figure.py", line 35, in <module>
    from matplotlib import _image
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\_image.py", line 7, in <module>
    __bootstrap__()
  File "C:\Users\...\Anaconda3_1\lib\site-packages\matplotlib\_image.py", line 6, in __bootstrap__
    imp.load_dynamic(__name__,__file__)
  File "C:\Users\...\Anaconda3_1\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

My version of Python is the following:

Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 15:01:46) [MSC v.1900 64 bit (AMD64)] 

I'm guessing this is a false positive by my antivirus (Avast), though I still get the second error after turning it off. Reinstalling the module or Anaconda did not work either.

Is it possible that my antivirus keeps deleting the DLL, and if so, is there a way to stop it from doing so? Or is my problem something else entirely?

Many thanks!

reed_TSA
  • 13
  • 4
  • 1
    Related question http://stackoverflow.com/questions/34004063/error-on-import-matplotlib-pyplot-on-anaconda3-for-windows-10-home-64-bit-pc – Pablo Aug 11 '16 at 10:43

1 Answers1

0

I had this exact same problem with Avast and matplotlib. My solution was to uninstall Anaconda, then reinstall the same version and add C:\Anaconda3 to the excepted scan directory in Avast.

duncster94
  • 570
  • 6
  • 23