yotkadata / meteo_hist

A web app to create interactive temperature and precipitation graphs for places around the world
https://yotka.org/meteo-hist/
Other
42 stars 3 forks source link

Not running on local machine #5

Closed somu24 closed 6 months ago

somu24 commented 6 months ago

getting the following error when we submit the location File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script exec(code, module.dict) File "C:\Users\Admin\meteo_hist\app.py", line 68, in main() File "C:\Users\Admin\meteo_hist\app.py", line 64, in main build_content(plot_placeholder, message_box) File "C:\Users\Admin\meteo_hist\app\build.py", line 118, in build_content input_processed = process_form(st.session_state["input_values"], message_box) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\meteo_hist\app\forms.py", line 253, in process_form lat, lon, location = build_location_by_name( ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\meteo_hist\app\utils.py", line 219, in build_location_by_name location = MeteoHist.get_lat_lon(location) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\meteo_hist\meteo_hist\base.py", line 506, in get_lat_lon location = location.json() ^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Roaming\Python\Python311\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

it was working until last week , issue persists from 3 days.

image

somu24 commented 6 months ago

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

yotkadata commented 6 months ago

Hi @somu24, thanks for reporting. I can't reproduce the error though. Does it still happen? It looks to me as if nominatim isn't returning a valid result. Which location are you trying as input? Does it happen with all locations?

somu24 commented 6 months ago

Yes, it happens for all the location, it is some Jsondecode error,

yotkadata commented 6 months ago

Still can't reproduce it. Could you please pull the latest code and run again? Are there any other error messages?

Could you add print(location) after line 756 in meteo_hist/base.py and run again? What is the output? https://github.com/yotkadata/meteo_hist/blob/7f3983906665578a1e091414425062fc7dae21b7/meteo_hist/base.py#L756

somu24 commented 6 months ago

Yes, it's absolutely working fine now, really thanks a lot