经过了一个暑假,好久没有使用实验室电脑里的python了,最近组会逼近,赶紧打开尘封已久的电脑,想着赶紧拾起上学期的思路,做点科研。但是当执行以前写好并调试好的程序时,出现了这样的错误:
Traceback (most recent call last):
File "E:/fish_track/Trace_main2.py", line 19, in <module>
import Background
File "E:\fish_track\Background.py", line 3, in <module>
from skimage import io,color,morphology,measure,filters,img_as_float,img_as_uint
File "D:\software\Anaconda\lib\site-packages\skimage\morphology\__init__.py", line 1, in <module>
from .binary import (binary_erosion, binary_dilation, binary_opening,
File "D:\software\Anaconda\lib\site-packages\skimage\morphology\binary.py", line 5, in <module>
from scipy import ndimage as ndi
File "D:\software\Anaconda\lib\site-packages\scipy\ndimage\__init__.py", line 161, in <module>
from .filters import *
File "D:\software\Anaconda\lib\site-packages\scipy\ndimage\filters.py", line 38, in <module>
from . import _ni_docstrings
File "D:\software\Anaconda\lib\site-packages\scipy\ndimage\_ni_docstrings.py", line 4, in <module>
from scipy.misc import doccer
File "D:\software\Anaconda\lib\site-packages\scipy\misc\__init__.py", line 68, in <module>
from scipy.interpolate._pade import pade as _pade
File "D:\software\Anaconda\lib\site-packages\scipy\interpolate\__init__.py", line 175, in <module>
from .interpolate import *
File "D:\software\Anaconda\lib\site-packages\scipy\interpolate\interpolate.py", line 21, in <module>
import scipy.special as spec
File "D:\software\Anaconda\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: 找不到指定的模块。
自己的语法绝对没问题,上学期已经调试通过了。而且大概看了看报错信息,明显是内部环境的问题,并且更可能是scipy包丢失了什么文件,立马卸载重装scipy包,但是问题还是没有解决。
这里插一句,python虽然好用,但是因为它封装得太深,对于这种莫名其妙而且直入底层的报错,反倒是最难调试的。
最后,google之后找到了一种解决方案,只需要打开系统控制台,执行以下两行代码即可,经测试可以解决该问题:
conda remove icc_rt --force
conda install icc_rt --no-deps
从代码来看,是重装了这个名叫icc_rt的包,但是这个包是干什么的,还没来得及深究,最后,附上整个解决方案的截图以待以后仔细研究。