0
votes

Here is my code can you please help me to execute my code. Currently it fails with:

chart_studio.exceptions.PlotlyRequestError: Authentication credentials were not provided

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
train=pd.read_csv('titanic_train.csv')
#sns.heatmap(train.isnull(),yticklabels=False,cbar=False,cmap='cividis')
import cufflinks as cf
import chart_studio.plotly as py
cf.go_offline()
train['Fare'].iplot(kind='hist',bins=30)
sns.set_style('whitegrid')
print(plt.show())

Full traceback is:

C:\Users\admin\PycharmProjects\untitled\venv\Scripts\python.exe C:/Users/admin/.PyCharmCE2018.3/config/scratches/me.py Traceback (most recent call last): File "C:/Users/admin/.PyCharmCE2018.3/config/scratches/me.py", line 711, in train['Fare'].iplot(kind='hist',bins=30) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\cufflinks\plotlytools.py", line 1218, in _iplot dimensions=dimensions,display_image=kwargs.get('display_image',True)) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\cufflinks\plotlytools.py", line 1471, in iplot filename=filename) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\plotly\plotly.py", line 135, in iplot url = plot(figure_or_data, **plot_options) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\plotly\plotly.py", line 280, in plot auto_open=False, File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\plotly\plotly.py", line 1087, in upload file_info = _create_or_overwrite_grid(payload) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\plotly\plotly.py", line 1550, in _create_or_overwrite_grid res = api_module.create(data) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\api\v2\grids.py", line 18, in create return request("post", url, json=body) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\retrying.py", line 49, in wrapped_f return Retrying(*dargs, **dkw).call(f, *args, **kw) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\retrying.py", line 206, in call return attempt.get(self._wrap_exception) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\retrying.py", line 247, in get six.reraise(self.value[0], self.value[1], self.value[2]) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\six.py", line 693, in reraise raise value File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\retrying.py", line 200, in call attempt = Attempt(fn(*args, **kwargs), attempt_number, False) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\api\v2\utils.py", line 180, in request validate_response(response) File "C:\Users\admin\PycharmProjects\untitled\venv\lib\site-packages\chart_studio\api\v2\utils.py", line 82, in validate_response raise exceptions.PlotlyRequestError(message, status_code, content) chart_studio.exceptions.PlotlyRequestError: Authentication credentials were not provided.

Process finished with exit code 1

1
Can you add the full traceback of your error to the question? There is one obvious error in your code above, in that it should just be plt.show() not print(plt.show()) but either way, I've just run the above code and can't reproduce your error. - David Buck
Do you have an account/are you attempting to authenticate Chart Studio? plotly.com/python/getting-started-with-chart-studio - David Buck

1 Answers

0
votes

It is no longer work with Pycharm and it doesn't have any effect over the work and i also found the code for that simply use below code and that will be perfectly work over pycharm . plot(train['Fare'].iplot(kind='hist',bins=30)) It plot the graph according to the requirement in a new browser.