Summary
When using yfinance Ticker.fast_into[“market_cap”] the data populates on my local machine, however, the data does not populate when hosting and launching the app on streamlit cloud.
I’m thinking the issue may be related to the version of yfinance used on both the local machine and server. My requirements.txt file hosted on github includes the proper version of yfinance.
Additionally, is the data source blocked or restricted by any firewall or security measures on the server hosting the Streamlit app?
Anything feedback would be greatly appreciated.
Steps to reproduce
**Code snippet: **
bond_etfs = ['AGG','HYG','LQD',"TLT","SHY","IEF",]
market_cap_df = pd.DataFrame(columns=["ETF","Market Cap"]
for etf in bond_etfs:
etf_info = yf.Ticker(etf)
market_cap = etf_info.fast_info["market_cap"]
market_cap_df = market_cap_df.append({"ETF": etf, "Market Cap": market_cap},
ignore_index=True)
st.dataframe(market_cap_df)
Expected behavior:
Expected for the data to be extracted, stored a new dataframe asnd populated on my application.
Below is a screenshot of whats happening on my local machine:
Actual behavior:
The data is not extracted, stored nor populated on my application.
Below is a screenshot of whats happening once my app is launched on the streamlit cloud server:
Debug info
- Streamlit version: 1.17.0
- Python version: 3.10
- Using Conda
- OS version: Catalina
- Browser version: Chrome
Requirements file
streamlit==1.17.0
streamlit-option-menu==0.3.2
requests==2.27.1
babel==2.10.1
Pillow==9.1.1
sklearn==0.0
pycoingecko==2.2.0
pandas==1.3.5
numpy==1.21.6
plotly-express==0.4.1
statsmodels==0.13.2
openpyxl==3.0.10
yfinance==0.2.9
Links
- Link to your GitHub repo:
- Link to your deployed app: https://guygnakpa.streamlit.app/