ConnectTimeout: HTTPSConnectionPool(host='fc.yahoo.com', port=443) - Error attempting yfinance.Ticker(..).info

947 Views Asked by At

I am trying to work with yfinance library (This is my first time attempting to work with it).

I attempted the following and it worked pip install yfinance --upgrade --no-cache-dir

I attempted the following in jupyter notebook and it worked import yfinance as yf sp500=yf.Ticker("^GSPC") print ("got sp500")

I am able to see the following line printed in the jupyter notebook

got sp500

When I attempt the following with or without the proxy, it errors out sp500.proxy="http://my-proxy.org.com:xxx" sp500.info

I see the following error ConnectTimeout: HTTPSConnectionPool(host='fc.yahoo.com', port=443): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000028F3FA23590>, 'Connection to fc.yahoo.com timed out. (connect timeout=30)'))

I am behind a proxy and I believe that this has something to do with it. Need a fix for this.

0

There are 0 best solutions below