Summary
These functions are downloading mutiple zipfiles from an ftp server, extract the files and saving them in the project folder (where the myapp.py is).
If I run the code directly in python it works and the files are written in the project folder but if I do it on my streamlit app the code will run but the folder stays empty. There are no error messages.
I am on windows and I am running the latest version of streamlit.
Steps to reproduce
Code snippet:
@st.cache_data
def download_and_unzip(url, extract_to='.'):
http_response = urlopen(url)
zipfile = ZipFile(BytesIO(http_response.read()))
zipfile.extractall(path=extract_to)
@st.cache_data
def get_storm_data():
# unzip all files
for zip_file in nhc_urls_list:
url_zip_file = url + zip_file
print("Downloading: " + url_zip_file)
download_and_unzip(url_zip_file)