Dear all,
I’m using Python 2.7.10 via the Spyder IDE. I’m trying to run the following Plotly code (taken from here: https://plot.ly/python/table/):
import plotly.plotly as py
from plotly.tools import FigureFactory as FF
data_matrix = [['Country', 'Year', 'Population'],
['United States', 2000, 282200000],
['Canada', 2000, 27790000],
['United States', 2005, 295500000],
['Canada', 2005, 32310000],
['United States', 2010, 309000000],
['Canada', 2010, 34000000]]
table = FF.create_table(data_matrix)
py.iplot(table, filename='simple_table')
I have also configured my username and API-key from my Plotly account. Sadly, I get the following error (SSL related);
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
The full error is given below. Does anyone know how to solve this?
>>> runfile('C:/Users/j079/Desktop/plotly_test.py', wdir='C:/Users/j079/Desktop')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)
File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/j079/Desktop/plotly_test.py", line 20, in <module>
py.iplot(table, filename='simple_table')
File "C:\Python27\lib\site-packages\plotly-1.12.3-py2.7.egg\plotly\plotly\plotly.py", line 151, in iplot
url = plot(figure_or_data, **plot_options)
File "C:\Python27\lib\site-packages\plotly-1.12.3-py2.7.egg\plotly\plotly\plotly.py", line 241, in plot
res = _send_to_plotly(figure, **plot_options)
File "C:\Python27\lib\site-packages\plotly-1.12.3-py2.7.egg\plotly\plotly\plotly.py", line 1426, in _send_to_plotly
verify=get_config()['plotly_ssl_verification'])
File "C:\Python27\lib\site-packages\requests\api.py", line 109, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Python27\lib\site-packages\requests\api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests\sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests\adapters.py", line 431, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)