Black Lives Matter. Please consider donating to Black Girls Code today.

Trouble with importing plotly in Jupyter notebook

I’ve went through the directions for the installation of plotly found on the site (i.e pip install plotly) etc. but I’m still having issues. I’m trying to run Jupyter notebook and use plotly within Jupyter notebook. I’m using the free version of plotly, and it is my understanding that I have to use plotly in the offline mode.

When I try to import in J Notebook, I get this error:


What should I be doing to be able to run plotly? Not sure if it’s relevant, but I launch J Notebook through terminal/localhost. Also, I’ve checked to see if plotly is installed and it is on my device.

Hey @gumesh

After following the instruction here try the below:

import plotly
import plotly.graph_objs as go



data = [

layout = go.Layout(

fig = go.Figure(data=data,layout=layout)

Hi, thanks for the response. I actually figured it out. My issue was that I wasn’t loading my username and API key properly, and also I had to do import plotly.plotly for it to work.

Thanks for all the help!