Open dsoeiro opened 1 week ago
yfinance/cache.py
already has logic for coping with a read-only cache folder, so probably it can be extended to also handle sqlite missing: https://github.com/ranaroussi/yfinance/blob/dfe3ec8df7be8da5e6addc629ed8dfa95e2f896d/yfinance/cache.py#L133
thanks @ValueRaider . Understood, thank you for the explanation. Is there anything I can contribute to help address this point? For example, would additional testing in environments where SQLite is unavailable be useful, or is there another way I could support this implementation?
You could develop and test a fix for missing sqlite? #1084
Describe bug
When running the Google Cloud Function with the latest version of Python and yfinance, the error SQLite driver not installed! occurred. This issue arose because the yfinance library attempts to use SQLite for caching, but the required SQLite driver is not available in the Cloud Function environment. As a result, the function failed to retrieve data properly (response: 'SQLite driver not installed!'). However, when using an older version like yfinance==0.1.63, it works, but returns zero results. If you run the same code locally with the latest version of both Python and yfinance, it works normally without any issues.
Simple code that reproduces your problem
from flask import jsonify, abort, request import yfinance as yf
def main(request):
request
response
requirements.txt
flask yfinance
Debug log
https://query2.finance.yahoo.com/v10/finance/quoteSummary/AAPL textPayload: "DEBUG params={'modules': 'financialData,quoteType,defaultKeyStatistics,assetProfile,summaryDetail', 'corsDomain': 'finance.yahoo.com', 'formatted': 'false', 'symbol': 'AAPL'}"
textPayload: "DEBUG cookie_mode = 'basic'"
textPayload: "DEBUG Entering _get_cookie_and_crumb()"
Bad data proof
No response
yfinance
versionlast
Python version
Python 3.12
Operating system
No response