我正在使用运行良好的python代码。我想使用openCV扩展它。所以我通过Anaconda下载了它。已成功安装。 import cv2
没有给出任何错误。但是现在我的原始代码不起作用:(
from skimage.filters import sobel
from skimage import data, color
from skimage.transform import hough_circle, hough_circle_peaks
from scipy.ndimage.filters import convolve
from skimage.morphology import remove_small_objects
from skimage.measure import label, regionprops
from matplotlib import pyplot
import numpy as np
import matplotlib.pyplot as plt
我正在导入所有这些文件,以前还不错。但是现在,在安装openCV之后,出现以下错误:
File "<ipython-input-2-6e90cef08b5c>", line 1, in <module>
runfile('D:/try1.py', wdir='D:')
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/try1.py", line 8, in <module>
from skimage import data, color
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\skimage\data\__init__.py", line 16, in <module>
from ..io import imread, use_plugin
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\skimage\io\__init__.py", line 7, in <module>
from .manage_plugins import *
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\skimage\io\manage_plugins.py", line 28, in <module>
from .collection import imread_collection_wrapper
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\skimage\io\collection.py", line 12, in <module>
from PIL import Image
File "C:\Users\name\AppData\Local\Continuum\anaconda3\lib\site-
packages\PIL\Image.py", line 58, in <module>
from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.
反正有解决此问题的方法吗?如果我要卸载openCV,它将起作用吗?现在,我只希望我的代码像以前一样工作!我将不胜感激任何帮助。