python使用scipy報錯:“ImportError: DLL load failed: 找不到指定的模組”的解決方案
阿新 • • 發佈:2019-02-13
好久沒有使用實驗室電腦裡的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包的問題,但是在解除安裝重灌之後,問題還是沒有解決。
這裡插一句,python雖然好用,但是因為它封裝得太深,對於這種莫名其妙而且直入底層的報錯,反倒是最難除錯的。
最後,google之後找到了一種解決方案,只需要執行以下兩行程式碼即可,經測試可以解決該問題:
conda remove icc_rt --force
conda install icc_rt --no-deps
從程式碼來看,是重灌了這個名叫icc_rt的包,但是這個包是幹什麼的,還沒來得及深究,最後,附上整個解決方案的截圖以待以後仔細研究。