GBERESEARCH / volvisualizer

Extract and visualize implied volatility from option chain data
MIT License
25 stars 8 forks source link

SSLCertVerificationError #2

Closed eo1989 closed 2 months ago

eo1989 commented 2 months ago

Attempted to use your project to visualize some implied volatility surfaces today regardless of the ticker I the interpreter kept returning an SSLCertVerificationError. "SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)" Running on windows, python 3.12.0.

edit: just tried with python 3.11 && same result. Looks like its coming from the site/api?

GBERESEARCH commented 2 months ago

Thanks for your message. It looks like Yahoo has made some updates to their HTML in the last few months so some of the data scraping wasn't working anymore. I've just uploaded a new version (1.1.10) that should fix this. A virtual environment running Python version 3.10 as per the README instructions should work (you shouldn't use Python 3.12 though as it's not compatible with matplotlib version 3.5.3).

GBERESEARCH commented 2 months ago

3.11 isn't compatible with mpl 3.5.3 either so that won't work. I've just tested the below to be working now:

$ py -3.10 -m venv .venv $ .venv\scripts\activate $ (.venv) python -m pip install --upgrade pip $ (.venv) python -m pip install matplotlib==3.5.3 $ (.venv) python -m pip install spyder $ (.venv) python -m pip install volvisualizer

(Within Spyder): from volvisualizer.volatility import Volatility imp = Volatility(ticker='^SPX', start_date='2024-05-06', wait=1, monthlies=True, q=0.0135)