ubarsc / python-fmask

A set of command line utilities and Python modules that implement the ‘fmask’ algorithm
https://www.pythonfmask.org
GNU General Public License v3.0
75 stars 21 forks source link

ImportError: cannot import name fillminima #19

Closed gillins closed 6 years ago

gillins commented 6 years ago

Original report by Anonymous.


Hello guys,

when a try execute this command:

#!Shell Script

fmask_usgsLandsatTOA.py -i LC08_L1TP_223071_20161226_20170315_01_T1_.vrt -m LC08_L1TP_223071_20161226_20170315_01_T1_MTL.txt -z LC08_L1TP_223071_20161226_20170315_01_T1_angle.img -o LC08_L1TP_223071_20161226_20170315_01_T1_toa.img

I got this error:

#!Shell Script
  File "/usr/local/bin/fmask_usgsLandsatTOA.py", line 23, in <module>
    from fmask import landsatTOA
  File "/usr/local/lib/python2.7/dist-packages/fmask/landsatTOA.py", line 29, in <module>
    from . import fmask
  File "/usr/local/lib/python2.7/dist-packages/fmask/fmask.py", line 68, in <module>
    from . import fillminima
  File "/usr/local/lib/python2.7/dist-packages/fmask/fillminima.py", line 37, in <module>
    from fmask import fillminima
ImportError: cannot import name fillminima

So I commented thoss part, and work:

fillminima.py file:

#!python

#if os.getenv('READTHEDOCS', default='False') != 'True':
#    from . import _fillminima

valueindexes.py

#!python

#if os.getenv('READTHEDOCS', default='False') != 'True':
#    from . import _valueindexes

The problem is occuring in python2.7 and python3.5.

PS: Your API is awesome. I love RIOS too. Great Job !

gillins commented 6 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


It appears the C modules that are part of fmask aren't installed. How did you install fmask? And were there any errors?

gillins commented 6 years ago

Original comment by Leandro Leal Parente (Bitbucket: leandrolealparente-admin, ).


You right. My fmask installation was in "/usr/local/", when I changed to "/usr/" the C modules were recognized.

Thanks very much.