GithubHelp home page GithubHelp logo

Cannot locate module 'coastsat' about coastsat HOT 10 CLOSED

kvos avatar kvos commented on June 12, 2024
Cannot locate module 'coastsat'

from coastsat.

Comments (10)

 avatar commented on June 12, 2024 1

Hello @kvos ,
Still awaiting approval by Google for Earth Engine. Please see earlier reply [Google manually approves]. I will let you know once I get approval :)

from coastsat.

kvos avatar kvos commented on June 12, 2024 1

Ok thanks for the info, this must be new because we never had to wait for approval from google before

from coastsat.

kvos avatar kvos commented on June 12, 2024

hi @dragonDaddy2012, there are 4 current issues (#41 #40 #33 ) with the same error message when initialising the ee package and that HTTP code 404....I'm not sure at the moment what can be going wrong as it works fine on my coastsat environment but I am sure that this can be fixed easily.
(for the spyder error "No module named coastsat", this is because you are not in the correct directory. You can navigate through directories on the top right panel of spyder and go to the directory that contains the /coastsat folder)

But this will not solve the second error with HTTP code 404. To debug this issue, could you please try the type the following commands on the anaconda prompt:

  • conda activate coastsat
  • python
  • import ee
    -ee.Initialize()

This should prompt the same error. To fix this I propose you remove the coastsat environment already installed (conda env remove --name coastsat and then conda clean --all) and re-install a new one with more updated versions of the packages.
The you can open the environment.yml file with a text editor and replace its content with the following:

channels:
  - defaults
  - conda-forge
dependencies:
  - python=3.7
  - matplotlib
  - earthengine-api
  - gdal
  - geopandas
  - pytz
  - scikit-image
  - scikit-learn
  - shapely
  - spyder
  - notebook

Then run conda env create -f environment.yml -n coastsat again and install the new environment. This should fix the issue, let me know. Cheers, Kilian

from coastsat.

 avatar commented on June 12, 2024

hi @dragonDaddy2012, there are 4 current issues (#41 #40 #33 ) with the same error message when initialising the ee package and that HTTP code 404....I'm not sure at the moment what can be going wrong as it works fine on my coastsat environment but I am sure that this can be fixed easily.
(for the spyder error "No module named coastsat", this is because you are not in the correct directory. You can navigate through directories on the top right panel of spyder and go to the directory that contains the /coastsat folder)

But this will not solve the second error with HTTP code 404. To debug this issue, could you please try the type the following commands on the anaconda prompt:

* `conda activate coastsat`

* `python`

* `import ee`
  -`ee.Initialize()`

This should prompt the same error. To fix this I propose you remove the coastsat environment already installed (conda env remove --name coastsat and then conda clean --all) and re-install a new one with more updated versions of the packages.
The you can open the environment.yml file with a text editor and replace its content with the following:

channels:
  - defaults
  - conda-forge
dependencies:
  - python=3.7
  - matplotlib
  - earthengine-api
  - gdal
  - geopandas
  - pytz
  - scikit-image
  - scikit-learn
  - shapely
  - spyder
  - notebook

Then run conda env create -f environment.yml -n coastsat again and install the new environment. This should fix the issue, let me know. Cheers, Kilian

I think I discovered the 404 error. Google manual approves account requests to access the images. I have put the request in and will re-attempt upon approval. I will navigate to the directory as well and see how that works.

from coastsat.

kvos avatar kvos commented on June 12, 2024

did you get it working?
Did you link your credentials with earthengine authenticate? you may need a Google account for this

from coastsat.

dragonDaddy2012 avatar dragonDaddy2012 commented on June 12, 2024

@kvos ,
got access - so, making progress. However, now we are getting stalled at:
output = SDS_shoreline.extract_shorelines(metadata, settings)

Error Message:

File "./CoastSat-master/coastsat/SDS_shoreline.py", line 525, in show_detection
    mng.window.showMaximized()

**AttributeError: 'FigureManagerBase' object has no attribute 'window'**

Running "example.py", changed the following:

polygon = [[[12.7408410319,45.5212666771],
            [12.7264214762,45.5381024608 ],
            [12.839717985,45.5984293404],
            [12.8737069376,45.5753637629],
            [12.7408410319,45.5212666771]]]

To see the full edited "example.py" and the data-specific pulls, please see the temp repo:
https://github.com/dragonDaddy2012/CoastSat_Linked

from coastsat.

kvos avatar kvos commented on June 12, 2024

ok @dragonDaddy2012 I think this is an easy fix...in Spyder go under Preferences>IPython console> Graphics andchange the Grapgics Backend to Automatic (instead of Inline), then restart Spyder. This will make the figures interactive and solve that issue.

By the way, could you shortly describe the process of getting access to GEE as I think other users are having the same problem, thanks

from coastsat.

dragonDaddy2012 avatar dragonDaddy2012 commented on June 12, 2024

@kvos
That seemed to have worked (it does, on the example.py). However, I have tried two sets of polygons, and in both instances, get the following error:

metadata = SDS_download.retrieve_images(inputs)
Downloading images:
Traceback (most recent call last):

  File "<ipython-input-3-81739100d1f3>", line 1, in <module>
    metadata = SDS_download.retrieve_images(inputs)

  File "/CoastSat-master/coastsat/SDS_download.py", line 538, in retrieve_images
    utm_zone_selected =  np.max(np.unique(utm_zones))

  File "/anaconda3/envs/coastsat/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 2505, in amax
    initial=initial)

  File "/anaconda3/envs/coastsat/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)

ValueError: zero-size array to reduction operation maximum which has no identity

(I will post actual script on same temp repo).

Regarding GEE, I'd be happy to describe:

You need to register for GEE via the GEE portal: https://signup.earthengine.google.com. This is free, however, you will need to provide some details (e.g. What you plan on using GEE for, etc.).

Google manually approves GEE requests as they are received. Once the form is submitted, Google will process and send a confirmation email. After approval, you will receive another email notification. That simple!

from coastsat.

kvos avatar kvos commented on June 12, 2024

I just had a look at your script and it looks like you have inverted longitudes and latitudes.
Thanks for describing the process, I have now added this to the documentation

from coastsat.

kvos avatar kvos commented on June 12, 2024

closing this issue as it is solved

from coastsat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.