For a few days now, my app ( https://mapagasolineras.streamlit.app/ ) has stopped working in the cloud, although it continues to work locally without any issues.
The error occurs when reading an xls file with this command:
URL = “https://geoportalgasolineras.es/resources/files/preciosEESS_es.xls”
df = pd.read_excel(URL, skiprows=3, engine=“xlrd”)
Can anyone help me?
Thank you very much.
In the past, this code solved a ssl error:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
Debug:
urllib.error.URLError: <urlopen error [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1129)>
urllib.error.URLError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 565, in _run_script
exec(code, module.dict)
File “/app/mapapreciocarburantes/MapaPrecioCarburantes.py”, line 127, in
df, prov_data, gdf, FAct = cargarFichero()
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 186, in call
return self._get_or_create_cached_value(args, kwargs)
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 211, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File “/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 265, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File “/app/mapapreciocarburantes/MapaPrecioCarburantes.py”, line 49, in cargarFichero
df = pd.read_excel(URL, skiprows=3, engine=“xlrd”)
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 478, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 1513, in init
self._reader = self._engines[engine](self._io, storage_options=storage_options)
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/excel/_xlrd.py”, line 35, in init
super().init(filepath_or_buffer, storage_options=storage_options)
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/excel/_base.py”, line 530, in init
self.handles = get_handle(
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/common.py”, line 716, in get_handle
ioargs = _get_filepath_or_buffer(
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/common.py”, line 368, in _get_filepath_or_buffer
with urlopen(req_info) as req:
File “/home/appuser/venv/lib/python3.9/site-packages/pandas/io/common.py”, line 270, in urlopen
return urllib.request.urlopen(*args, **kwargs)
File “/usr/local/lib/python3.9/urllib/request.py”, line 214, in urlopen
return opener.open(url, data, timeout)
File “/usr/local/lib/python3.9/urllib/request.py”, line 517, in open
response = self._open(req, data)
File “/usr/local/lib/python3.9/urllib/request.py”, line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File “/usr/local/lib/python3.9/urllib/request.py”, line 494, in _call_chain
result = func(*args)
File “/usr/local/lib/python3.9/urllib/request.py”, line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File “/usr/local/lib/python3.9/urllib/request.py”, line 1349, in do_open
raise URLError(err)