Importerror: No Module Named Filters
Solution 1:
The problem is resolved now :D. What I found is that there is no module named 'filters' in skimage '0.10.1' as it has 'filter'. So, when I upgraded it using the command
sudo pip install --upgrade scikit-image
to version '0.13.1', it comes with the 'filters' module instead of 'filter'. The 'filters' module has all attributes of thresholding including 'local' and others as well.
Solution 2:
So I got same problem in Spyder, Python 3.6.6.
this code (with img being a np array):
importskimageval= skimage.filters.threshold_otsu(img)
gives: module 'skimage' has no attribute 'filters'
I tried pip install --upgrade scikit-image with no change. Skimage is indeed in my system path: *'C:\WPy-3661\python-3.6.6.amd64\lib\site-packages', and the filters folder is in there with the init file.
but if i do:
from skimage import filters as anything
val = skimage.filters.threshold_otsu(img)
then it works. This is not normal, right ?
Note that in my sys.path paths there is only one skimage folder. So I don't think it's a duplicate issue.
Solution 3:
I had also same problem but below code helped me:
!sudo apt-get install python-skimage
from skimage.filters import roberts, prewitt, sobel, scharr, laplace
Post a Comment for "Importerror: No Module Named Filters"