yfinance: OperationalError('unable to open database file')

1.6k Views Asked by At

I'm getting the following error when trying to download stock price data from yahoo finance using the yfinance package: OperationalError('unable to open database file')

It seems the prices are just not downloading. What can I do to resolve this error? I've not come across a solution yet on the internet.

Thank you very much in advance!

Unable to open database file

I googled, upgraded pip installation, reinstalled anaconda, resetted Windows, played around with folder permissions, ran as admin... nothing worked.

3

There are 3 best solutions below

1
NewLineCinema2 On

Maybe it was a temporary connection error from their side. It should work now as you can see from me:enter image description here

3
scottsuhy On
pip uninstall yfinance && pip install yfinance==0.2.28

worked for me...

0
Ratnam On

If tool has no permissions to create a temporary folder to store the downloaded data, it throws this error. For example I got the same issue in Windows. Created a folder py-yfinance in the directory- C:\Users\<username>\AppData\Local\, fixed the issue. It should work in other os also. Reference from https://github.com/ranaroussi/yfinance/issues/1694