import plotly.plotly as py
import plotly.tools as tls
from plotly.graph_objs import *
PlotlyRequestError: Aw, snap! You tried to use our API as the user ‘myuserbame’, but the supplied API key doesn’t match our records. You can view your API key at plot.ly/settings.
If you already have an username and you generated an API key, then delete the line
tls.set_credentials_file(“myusername”, “my_API_Key”) from your code.
In case you haven’t a Plotly account yet, read this answer to similar question:
@Karachay You should have a Plotly account to post the plot on the Plotly cloud. To sign up go to this page:
https://help.plot.ly/how-to-sign-up-to-plotly/ and click on SIGN UP, in the upper right corner.
Once you have an account choose Settings from the upper right dropdown menu, and then click on the API keys and Regenerate Key. Copy the generated key and save it somewhere to use it when you post a new plot. Namely, sign in via the line of code, inserted before py.iplot():
I just realized that it works ONLY on the jupyter notebook on localhost. When I try the API on the jupyter notebook on the Virtual Machine hosted on Google Cloud Platform,it does not work and produce the error which I have listed above.