greppo-io/greppo

file not found error

shantanuo opened this issue · 16 comments

I am able to install greppo package. But getting this error:


# greppo serve app.py --host 172.31.38.540
INFO:     Started server process [10836]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://172.31.38.540:8080 (Press CTRL+C to quit)
INFO:     18.209.195.135:54298 - "GET / HTTP/1.1" 200 OK
INFO:     18.209.195.135:54298 - "GET /css/app.a14da775.css HTTP/1.1" 200 OK
INFO:     18.209.195.135:54297 - "GET /css/chunk-vendors.db50bcea.css HTTP/1.1" 200 OK
INFO:     18.209.195.135:54301 - "GET /js/chunk-vendors.526a29f2.js HTTP/1.1" 200 OK
INFO:     18.209.195.135:54300 - "GET /js/app.7529265e.js HTTP/1.1" 200 OK
ERROR:fiona._env:geospatial_data.geojson: No such file or directory
INFO:     18.209.195.135:54301 - "GET /api HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "fiona/_shim.pyx", line 83, in fiona._shim.gdal_open_vector
  File "fiona/_err.pyx", line 291, in fiona._err.exc_wrap_pointer
fiona._err.CPLE_OpenFailedError: geospatial_data.geojson: No such file or directory

Can you check if you have specified the path of the file properly? It is best to pass the absolute path of the file.

Tried. Same error. Is there a docker image for this?

Even docker did not work:

#0 6.641       Failed to get options via gdal-config: [Errno 2] No such file or                                                                              directory: 'gdal-config'
#0 6.641       A GDAL API version must be specified. Provide a path to gdal-conf                                                                             ig using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment va                                                                             riable.

I am using ARM processor. May be that is not compatible with this.

The Dockerfile was tested both on a M1 and on an Intel chip. Do you have your code somewhere, that I could debug?

I was not using the app.py file from tests folder. I used
cd library/tests

then used this command:
greppo serve app.py --host 172.31.38.540

and got this error:

fiona.errors.DriverError: tests/data/us-states.geojson: No such file or directory

When I tried this command it worked as expected:
greppo serve v30.py --host 172.31.38.540

I appreciate your help.

When I moved the app.py file to /greppo/library/ folder it worked as expected. I think it should be made clear in the documentation.
But the problem is that I get "KeyError: EE_EMAIL". I am a member of google earth service. But I do not know my EE_EMAIL

I managed to solve the credentials problem. But when I used this code...
https://docs.greppo.io/mental-model.html

got this error:

TypeError: overlay_layer() takes 1 positional argument but 2 were given

Could you provide me a snippet of the code where you use overlay_layer ?

I used all the code mentioned on this page...

https://docs.greppo.io/mental-model.html

This code line did not work:

app.overlay_layer(
    data_gdf_1,
    name="Communes",
    description="Communes in Normandy, France",
    style={"fillColor": "#F87979"},
    visible=True,
)

In fact all the samples in quickstart guide having overlay_layer() method has this problem. May be I have not installed the module correctly.

By the way greppo seems to be awesome. I have seen other high level modules, but it looks like highest level module!

I'll take a look into this. In the meanwhile, can you use the vector_layer instead?

import geopandas as gpd
from greppo import app

data_gdf = gpd.read_file("./data/communes.geojson")

app.vector_layer(
    data = data_gdf,
    name = "Communes",
    description = "Communes in Normandy, France",
    style = {"fillColor": "#F87979"},
)

They are both the same. But overlay_layer use vector layer internally.

I'll take a look into this. In the meanwhile, can you use the vector_layer instead?

import geopandas as gpd
from greppo import app

data_gdf = gpd.read_file("./data/communes.geojson")

app.vector_layer(
    data = data_gdf,
    name = "Communes",
    description = "Communes in Normandy, France",
    style = {"fillColor": "#F87979"},
)

They are both the same. But overlay_layer use vector layer internally.

I had the same problem yesterday. I just try the vector layer module and as well the overlay layer and all are working perfectly !

image

image

.. and for the record, Greppo is amazing ! Amazing work Adithya Krishnan 😎

Yes "vector_layer" works as expected. A novice (like me) may think that those 2 are different. Please update the documentation if required.

For what it's worth, I also had this issue and it seems to have been resolved by explicitly setting data=data_gdf as opposed to just having data_gdf.

Yes. Setting data=data_gdf explicitly solved the problem. Thanks @srizer
Can someone fix the documentation and examples?

You could make a PR to the docs repo: https://github.com/greppo-io/greppo-docs