Suman Nagaraj
Suman Nagaraj

Reputation: 145

SSLError: HTTPSConnectionPool(host='www.quandl.com', port=443): Max retries exceeded

I am facing an issue. Kindly help me

Here's the code:

import pandas
import quandl
import time

df = quandl.get('FINRA/FNSQ_GOOGL')
print(df.head())

and the error which i am facing is:

Traceback (most recent call last):

  File "C:\Users\Desktop\My Folder\test.py", line 5, in <module>
    df = quandl.get('FINRA/FNSQ_GOOGL')

  File "C:\Python27\lib\site-packages\quandl\get.py", line 48, in get
    data = Dataset(dataset_args['code']).data(params=kwargs, handle_column_not_found=True)

  File "C:\Python27\lib\site-packages\quandl\model\dataset.py", line 47, in data
    return Data.all(**updated_options)

  File "C:\Python27\lib\site-packages\quandl\operations\list.py", line 14, in all
    r = Connection.request('get', path, **options)

  File "C:\Python27\lib\site-packages\quandl\connection.py", line 36, in request
    return cls.execute_request(http_verb, abs_url, **options)

  File "C:\Python27\lib\site-packages\quandl\connection.py", line 50, in execute_request
    raise e

SSLError: HTTPSConnectionPool(host='www.quandl.com', port=443): Max retries exceeded with url: /api/v3/datasets/FINRA/FNSQ_GOOGL/data?order=asc (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

import pandas 
import quandl
import time

df=''
while df=='':
try:
    df = quandl.get('FINRA/FNSQ_GOOGL')
except:
    time.sleep(5)
    print("try")
    continue
print(df.head())

It would be grateful if somebody help me solve this issue. Thanks in advance!!

Upvotes: 5

Views: 26081

Answers (6)

Ishteaque Alam
Ishteaque Alam

Reputation: 221

You can temporarily disable SSL verification:

url = 'https://Your_URL_here/'    
quandl.get(url, verify=False)

Or, if someone using the requests library:

requests.get(url, verify=False)

You might get a "InsecureRequestWarning" but this should work.

Upvotes: 0

Ashutosh
Ashutosh

Reputation: 1

Use HTTPS:

print(requests.get('https://www.yahoo.com'))

Using HTTP (print(requests.get('http://www.yahoo.com'))) will not work

Upvotes: 0

Chirag Chhatbar
Chirag Chhatbar

Reputation: 379

installing pyOpenSSL helped me and was able to solve for this error.

pip install pyOpenSSL

Upvotes: 1

JPan
JPan

Reputation: 11

I had a similar issue and found out that since I was behind a corporate firewall, it was causing issues. setting http proxies fixed this issue as well as other pip issues that I was facing. try the following:

import os
os.environ["HTTP_PROXY"]="<yourproxy>"

Upvotes: 1

Suman Nagaraj
Suman Nagaraj

Reputation: 145

It was Firewall issue. When I turned off the firewall i was able to fetch the dataset.

Upvotes: 1

mhawke
mhawke

Reputation: 87064

df = quandl.get('FINRA/FNSQ_GOOGL') works fine for me. The error says that certificate verification failed which means that your client is not able to verify the server's certificate. You might need to update your SSL CA certificate bundle.

You might try upgrading the certifi package: pip install -U certifi. My system is using certifi-2017.11.5.

Upvotes: 0

Related Questions