2
votes

I am using plotly express and just copied the official example from the below website in my jupyter notebook. The plot didn't show after running fig.show().

https://plot.ly/python/plotly-express/

import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length")
fig.show()

I did install pip3 install dash==1.8.0

I am using python 3.5

Thanks for your help.

Regards


Update:

I think i have to run it from .py file directly instead of using jupyter notebook. It works sometimes. Sometime, it doesn't work after opening a new browser. The error say:

This site can’t be reached 127.0.0.1 refused to connect.

not sure what is the problem?

anyone can help? Thanks

1

1 Answers

1
votes

You need to install ipywidgets.

$ pip install "notebook>=5.3" "ipywidgets>=7.2"

or if you use conda

$ conda install "notebook>=5.3" "ipywidgets>=7.2"

Then relaunch your Jupyter notebook.

See the getting started official documentation (section Jupyter Notebook Support).