Plotly Timeline Import Error

I tried to import plotly express timeline
Line 8: from plotly.express import timeline

and recieved the following error

ImportError: cannot import name 'timeline' from 'plotly.express' (/usr/local/lib/python3.7/site-packages/plotly/express/__init__.py)
You're using the Basic Python runtime.
Try selecting a different Python version!
at PlotlyModule, line 8
  called from /downlink/anvil_downlink_worker/__init__.py, line 70
  called from /downlink/anvil_downlink_worker/__init__.py, line 176
  called from PlotContracts, line 26

I have confirmed this app is actually using Full Python 3.
Any ideas?

Can anyone confirm that Plotly Express and Timeline are available please?
I still get an error when calling timeline (based on code from Plotly Docs)

import plotly.express as px

fig = px.timeline(df, x_start="Start", x_end="Finish", y="Task", color="Status")

Gives the following error

AttributeError: module 'plotly.express' has no attribute 'timeline'

Hi Anvil Team,

Can you please advise whether plotly.express.timeline will be available through Anvil?
The Figure Factory equivalent create_gantt() which does work in Anvil has been deprecated and has limited functionality.

If not, does anyone have any graphing package recommendations for gantt style charts as Figure Factory is just not cutting it.

Hi Rick,

This is definitely on our list to look at - thank you for keeping it on our radar!

This blog post has a good round-up of plotting options, so hopefully one of them will work for what you need - I also found this which seems to indicate that Altair at least has decent Gantt capability.

Thanks for the update and links @eli-anvil Ill check them out.

Hi @eli-anvil I see this has now been updated and working beautifully!!
This and the colour mapping to pie graphs will make building plots SOOOO much easier.
Thank you @anvil

1 Like

Well spotted! Yes, the built-in plotly integration has now been updated to the latest version. Sorry this took so long, but we now have all the machinery we need to keep this updated much more easily in future!

3 Likes