-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.2.29 bug: OperationalError('unable to open database file') #1694
Comments
You plan on editing with error message and working code? |
i added, tell me of this is enough, it's fail with 0.2.29, but ok with 0.2.28 |
Run again debug logging enabled. Like the bug report template instructed. |
done! |
same |
I can't debug until tomorrow, but here's summary in case someone else can. Previous version was 99% thread-safe. In rare cases the thread-safety failed. Latest version switches to |
Confirmed. Fails on my CI pipeline in python |
There's clearly a bug in 0.2.29. Keep replies constructive and concise. |
@enzbus how many CPUs on your mac, vs how many on system running pipeline? |
My sample fail on Google colab |
So far I've only observed failure on github CI, which is single processor (I believe). My machine has multiple processors. The only way I call
(And then |
I am encountering the same problem, both on python 3.9 and 3.11. FWIW, the machine I'm running uses Ryzen 5 5600X CPU. |
Not sure if this is related, but I am having a similar issue when using If I manually create the |
In my case (windows using Git Bash), I found that this is due to the fact that I manually created the Edit: I see it's been identified already here |
but I don't know how to solve it |
The problem is beyond just this. I tried a few other yahoo finance packages & they also couldn't return data. There might be an api issue... |
@The-Milad-A That's a different problem. But working for me. |
I can confirm the error on my Linux environment. The peewee library does not create the py-yfinance folder. Tried your fix @ValueRaider and it worked. |
Can I get more confirmation that my refactor hasn't introduced bugs? Then can get a release out before markets open. |
@ValueRaider Sorry for the late reply. Tested the latest version of yfinance (with your fixes) and it works perfectly in my simple use case: data = ticker.history(period="max", interval="1d", actions=False, auto_adjust=True). |
@ValueRaider |
@federico999999 The fix is included in the new release 0.2.30. You can just fetch the new version from pypi: |
@ValueRaider thanks for the fast fix! |
Thank you |
Describe bug
fail when downloading array, work ok in 0.2.28
Simple code that reproduces your problem
Debug log
DEBUG Entering download()
DEBUG:yfinance:Entering download()
DEBUG Disabling multithreading because DEBUG logging enabled
DEBUG:yfinance: Disabling multithreading because DEBUG logging enabled
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
DEBUG Entering history()
DEBUG:yfinance: Entering history()
ERROR
24 Failed downloads:
ERROR:yfinance:
24 Failed downloads:
ERROR ['TMF', 'TMV', 'VBINX', 'SHV', '^GVZ', 'VXZ', '^VIX', 'SGOV', 'TLT', 'QQQ', '^VXN', 'GLL', 'SPHD', 'SPY', 'TQQQ', 'QLD', 'SPLV', 'TBF', 'IAU', '^VXTLT', 'GLD', 'XLU', 'VXX', 'UGL']: OperationalError('unable to open database file')
ERROR:yfinance: ['TMF', 'TMV', 'VBINX', 'SHV', '^GVZ', 'VXZ', '^VIX', 'SGOV', 'TLT', 'QQQ', '^VXN', 'GLL', 'SPHD', 'SPY', 'TQQQ', 'QLD', 'SPLV', 'TBF', 'IAU', '^VXTLT', 'GLD', 'XLU', 'VXX', 'UGL']: OperationalError('unable to open database file')
DEBUG ['TMF', 'TMV', 'VBINX', 'SHV', '^GVZ', 'VXZ', '^VIX', 'SGOV', 'TLT', 'QQQ', '^VXN', 'GLL', 'SPHD', 'SPY', 'TQQQ', 'QLD', 'SPLV', 'TBF', 'IAU', '^VXTLT', 'GLD', 'XLU', 'VXX', 'UGL']: Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3192, in connect
self._state.set_connection(self._connect())
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3536, in _connect
conn = sqlite3.connect(self.database, timeout=self._timeout,
sqlite3.OperationalError: unable to open database file
DEBUG:yfinance: ['TMF', 'TMV', 'VBINX', 'SHV', '^GVZ', 'VXZ', '^VIX', 'SGOV', 'TLT', 'QQQ', '^VXN', 'GLL', 'SPHD', 'SPY', 'TQQQ', 'QLD', 'SPLV', 'TBF', 'IAU', '^VXTLT', 'GLD', 'XLU', 'VXX', 'UGL']: Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3192, in connect
self._state.set_connection(self._connect())
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3536, in _connect
conn = sqlite3.connect(self.database, timeout=self._timeout,
sqlite3.OperationalError: unable to open database file
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/yfinance/multi.py", line 275, in _download_one
data = Ticker(ticker, session=session).history(
File "/usr/local/lib/python3.10/dist-packages/yfinance/utils.py", line 114, in wrapper
result = func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/yfinance/base.py", line 148, in history
tz = self._get_ticker_tz(proxy, timeout)
File "/usr/local/lib/python3.10/dist-packages/yfinance/base.py", line 1644, in _get_ticker_tz
cache = utils.get_tz_cache()
File "/usr/local/lib/python3.10/dist-packages/yfinance/utils.py", line 985, in get_tz_cache
_tz_cache = _TzCache()
File "/usr/local/lib/python3.10/dist-packages/yfinance/utils.py", line 926, in init
db.connect()
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3191, in connect
with exception_wrapper:
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3019, in exit
reraise(new_type, new_type(exc_value, *exc_args), traceback)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 192, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3192, in connect
self._state.set_connection(self._connect())
File "/usr/local/lib/python3.10/dist-packages/peewee.py", line 3536, in _connect
conn = sqlite3.connect(self.database, timeout=self._timeout,
peewee.OperationalError: unable to open database file
DEBUG Exiting download()
DEBUG:yfinance:Exiting download()
2023-09-22-15-59 tickers.pkl
loading fresh 2023-09-22-15-59 tickers.pkl
spy_return spy_close
tlt_return tlt_close
iau_return iau_close
gld_return gld_close
qqq_return qqq_close
vix_return vix_close
vxtlt_return vxtlt_close
gvz_return gvz_close
qld_return qld_close
vxz_return vxz_close
tbf_return tbf_close
vxn_return vxn_close
vxx_return vxx_close
tmf_return tmf_close
tmv_return tmv_close
splv_return splv_close
sphd_return sphd_close
vbinx_return vbinx_close
xlu_return xlu_close
tqqq_return tqqq_close
ugl_return ugl_close
gll_return gll_close
sgov_return sgov_close
shv_return shv_close
Bad data proof
No response
yfinance
version0.2.29
Python version
No response
Operating system
No response
The text was updated successfully, but these errors were encountered: