First Time User - Receiving an error when deploying app using Yfinance

I am trying to deploy my code to streamlit for the first time.

FileNotFoundError: [Errno 2] No such file or directory: ‘/home/appuser/.cache/py-yfinance’

I verified my requirements.text file in my github repository also contains the yfinance module. The python script runs locally without issue. What am I missing?

Hi @icesword215

Prior to import yfinance as yf, can you add the following:

import appdirs as ad
ad.user_cache_dir = lambda *args: "/tmp"

It seems that it could not write to the mentioned cache in the error traceback. As per the solution provided at a related GitHub issues post as shown above, the app is now displaying properly.

Also see the forked repo GitHub - sfc-gh-cnantasenamat/finance-app
And deployed app https://finance-app-jy7zv8jmcrev6xv9dnhtdq.streamlit.app/

Hope this helps!

Yup that did it! Thank you for the help.

I will have to read into that more. I would have never thought to try that.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.