Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I got: chart_studio.exceptions.PlotlyRequestError: Authentication credentials were not provided

I am working locally(in my pc) just testing and learning PLOTLY 3.7.5. with anaconda env active. The code example is given by plotly

Code:

import plotly.plotly as py  # Here all begins (Look)
# import chart_studio.plotly as py  # inted of the line bellow (optional to  try)
import plotly.graph_objs as go
import pandas as pd
from datetime import datetime

if __name__ == '__main__':
    df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
    trace = go.Ohlc(x=df['Date'],
                    open=df['AAPL.Open'],
                    high=df['AAPL.High'],
                    low=df['AAPL.Low'],
                    close=df['AAPL.Close'])
    data = [trace]
    py.iplot(data, filename='simple_ohlc')

note (Look): I got the warning error:

'please install the chart-studio package and use the chart_studio.plotly module instead.'

like image 977
Boris Fischman Avatar asked Nov 25 '19 12:11

Boris Fischman


People also ask

What if my company has a chart Studio Enterprise Server?

Remember to replace "your-company.com" with the URL of your Chart Studio Enterprise server. If your company has a Chart Studio Enterprise server, change the Python API endpoint so that it points to your company's Plotly server instead of Plotly's cloud.

How do I install chart studio in Plotly?

New to Plotly? To install Chart Studio's python package, use the package manager pip inside your terminal. If you don't have pip installed on your machine, click here for pip's installation instructions. Plotly's Python package is installed alongside the Chart Studio package and it is updated frequently!

How do I upgrade my chart studio account?

To upgrade, run: Chart Studio provides a web-service for hosting graphs! Create a free account to get started. Graphs are saved inside your online Chart Studio account and you control the privacy. Public hosting is free, for private hosting, check out our paid plans .

How do I Share my chart with other chart studio users?

You can privately share this graph with other Chart Studio users in your online Chart Studio account and they will need to be logged in to view this plot. secret: Anyone with this secret link can view this chart. It will not appear in the Chart Studio feed, your profile, or search engines.


3 Answers

You need plotly's offline mode to obviate authentication - following https://stackoverflow.com/a/44694854/1021819, rather do:

from plotly.offline import iplot
like image 136
jtlz2 Avatar answered Oct 23 '22 04:10

jtlz2


use below line of code before hitting pilot

cf.go_offline() #will make cufflinks offline
cf.set_config_file(offline=False, world_readable=True)
like image 43
Kartik Gaur Avatar answered Oct 23 '22 05:10

Kartik Gaur


import pandas as pd
import numpy as np
%matplotlib inline
import plotly.graph_objs as go
from  plotly.offline import plot
import chart_studio.plotly as py
import cufflinks as cf
cf.go_offline()
from plotly.offline import download_plotlyjs, init_notebook_mode, plot,iplot
init_notebook_mode(connected='true')
df = pd.DataFrame(np.random.randn(100,4),columns='A B C D'.split())
df.head()
df.iplot(kind='box')
like image 1
Ashish Sharma Avatar answered Oct 23 '22 03:10

Ashish Sharma