ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
13.24k stars 2.34k forks source link

yfinance python package creating problem in deployment #1710

Closed tusharrusia closed 1 year ago

tusharrusia commented 1 year ago

IMG_20231001_225221

I am trying to host a Django Application with yfinance as one of the package using pythonanywhere.com which gives 500 MB free space.There are only three packages Django, plotly and yfinance but the size of built is crossing more than 500mb.

I have noticed that there are many packages installed simultaneously when yfinance is installed. Are they all necessary or is there any way to avoid them ?

rickturner2001 commented 1 year ago

Can you please provide the full Error log message?

tusharrusia commented 1 year ago

Can you please provide the full Error log message?

There is no particular error , the error is just that you have overshoot the allowed disc space while installing yfinance

rickturner2001 commented 1 year ago

starting from scratch a venv is around 26Mb after pip install yfinance the venv is going to be something like 214Mb

after installing yfinance you should have plenty of room for whatever you need.

tusharrusia commented 1 year ago

I successfully solved the issue. The problem was that the linux remote server was collecting some cache files of around 100 Mb. I first installed yfinance, then django and then deleted the cache manually and then installed plotly. Yfinance needed some necessary cache files which I installed with the command : dpkg -S /var/cache and apt-get --reinstall install yfinance

The point is that cache contains mostly temporary files which could be deleted !

tusharrusia commented 1 year ago

Indeed yfinance is a large package due to its dependencies crossing around 200 Mb after installation. To optimize the Disc space in case of constraints, cache files can be safely deleted. Cache files contains mostly temporary files which could be easily deleted and if any python package is giving any error due to missing necessary cache files it can be restored using the command: dpkg -S /var/cache and apt-get --reinstall install PACKAGE_NAME