fitoprincipe / geebap

Best Available Pixel (BAP) composite in Google Earth Engine (GEE) using the Python API
GNU General Public License v3.0
84 stars 23 forks source link

Problem upon import #6

Closed e5k closed 5 years ago

e5k commented 5 years ago

Hi Rodrigo,

Thanks for the updates. I have updated to 0.2.2, Conda 3.6 and I get this error during import. Any idea why?

Thanks a lot

S

>>> from geebap import bap
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/__init__.py", line 24, in <module>
    from . import bap, date, expgen, expressions, filters, functions,\
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/bap.py", line 5, in <module>
    from . import scores, priority, functions, utils, __version__
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/scores.py", line 33, in <module>
    from . import priority
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/priority.py", line 23, in <module>
    class SeasonPriority(object):
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/geebap/priority.py", line 55, in SeasonPriority
    ee_relation = ee.Dictionary(relation)
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/computedobject.py", line 32, in __call__
    return type.__call__(cls, *args, **kwargs)
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/dictionary.py", line 27, in __init__
    self.initialize()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/dictionary.py", line 48, in initialize
    apifunction.ApiFunction.importApi(cls, 'Dictionary', 'Dictionary')
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/apifunction.py", line 180, in importApi
    cls.initialize()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/apifunction.py", line 151, in initialize
    signatures = data.getAlgorithms()
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/data.py", line 426, in getAlgorithms
    return send_('/algorithms', {}, 'GET')
  File "/Users/sebastien/anaconda3/envs/ee/lib/python3.6/site-packages/ee/data.py", line 838, in send_
    response.status)
ee.ee_exception.EEException: Server returned HTTP code: 404
fitoprincipe commented 5 years ago

Hi @e5k , have you initialize Earth Engine? In the new code it does not auto initialize, so you will have to write:

import ee
ee.Initialize()
from geebap import bap
e5k commented 5 years ago

...long day... Obviously! Thanks @fitoprincipe

e5k commented 5 years ago

BTW: Maybe could you change the example in the readme file to show the import ee before import geebap? Thanks!

fitoprincipe commented 5 years ago

Yes, sure! Thanks =)

fitoprincipe commented 5 years ago

@e5k the code in the README is not updated at all, I'll update it now to match the new version. Thanks again