当尝试导入matplotlib.pyplot(在Spyder中)时,我收到以下错误:
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.
如果我再尝试导入它,我会得到以下内容:
>>> 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.
我的Python版本如下:
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Jan 29 2016, 15:01:46) [MSC v.1900 64 bit (AMD64)]
我猜这是我的防病毒软件(Avast)的误报,但是在关闭它后仍然会出现第二个错误。重新安装模块或Anaconda也不起作用。
我的防病毒软件是否有可能继续删除DLL,如果是这样,有没有办法阻止它这样做?或者我的问题完全是另一回事?
非常感谢!
答案 0 :(得分:0)
我对Avast和matplotlib有同样的问题。我的解决方案是卸载Anaconda,然后重新安装相同的版本并将C:\ Anaconda3添加到Avast中的例外扫描目录。