Plotly Express: AttributeError: 'Layout' object has no attribute 'color_scale'

I tried running the example from the documentation,

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

but it get the error,

Traceback (most recent call last):
  File "/home/emher/DashProjects/dash-extensions/px_example.py", line 3, in <module>
    fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species")
  File "/home/emher/DashProjects/dash-extensions/venv/lib/python3.8/site-packages/plotly/express/_chart_types.py", line 64, in scatter
    return make_figure(args=locals(), constructor=go.Scatter)
  File "/home/emher/DashProjects/dash-extensions/venv/lib/python3.8/site-packages/plotly/express/_core.py", line 1829, in make_figure
    apply_default_cascade(args)
  File "/home/emher/DashProjects/dash-extensions/venv/lib/python3.8/site-packages/plotly/express/_core.py", line 897, in apply_default_cascade
    and args["template"].layout.color_scale.sequential
  File "/home/emher/DashProjects/dash-extensions/venv/lib/python3.8/site-packages/plotly/basedatatypes.py", line 4930, in __getattr__
    return super(BaseLayoutHierarchyType, self).__getattribute__(prop)
AttributeError: 'Layout' object has no attribute 'color_scale'

On the other hand, everything works as intended if i just plot the graph using graph objects. I am on Dash 1.16.1 (and plotly plotly==4.9.0 if that matters). Has anyone else experienced this kind of issues?