Pandas not working with plotly python

I have been using Plotly with plain Python and was able to create a number of charts with a funnel chart at the top and a 3 line scatter chart below with mode = lines+markers and changed each of the 3 lines to a different color. These charts were created from PostgreSQL SQL queries.

I then changed to using Pandas with a pd.read_sql command. The command works fine for the Funnel chart and it seems to work with the scatter but the problem comes when I issue the command “fig.write_html”. On that line I get thefollowing errors:
"Traceback (most recent call last):
File “/mnt/seagate/Weather/wx_env/./weather.py”, line 50, in
fig1.write_html(’/mnt/seagate/gsb-wx.me/static/images/Today_temp.html’, include_plotlyjs=False)
File “/home/gerald/.local/lib/python3.9/site-packages/plotly/basedatatypes.py”, line 3685, in write_html
return pio.write_html(self, *args, **kwargs)
File “/home/gerald/.local/lib/python3.9/site-packages/plotly/io/_html.py”, line 508, in write_html
html_str = to_html(
File “/home/gerald/.local/lib/python3.9/site-packages/plotly/io/_html.py”, line 137, in to_html
jdata = json.dumps(
File “/usr/local/lib/python3.9/json/init.py”, line 234, in dumps
return cls(
File “/home/gerald/.local/lib/python3.9/site-packages/_plotly_utils/utils.py”, line 59, in encode
encoded_o = super(PlotlyJSONEncoder, self).encode(o)
File “/usr/local/lib/python3.9/json/encoder.py”, line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File “/usr/local/lib/python3.9/json/encoder.py”, line 257, in iterencode
return _iterencode(o, 0)
File “/home/gerald/.local/lib/python3.9/site-packages/_plotly_utils/utils.py”, line 134, in default
return _json.JSONEncoder.default(self, obj)
File “/usr/local/lib/python3.9/json/encoder.py”, line 179, in default
raise TypeError(f’Object of type {o.class.name} ’
TypeError: Object of type method is not JSON serializablet "

Also when I tried to use plotly.express it did not recognize the following commands: “mode, name or line_color”

How can get rid of those JSON errors and be able to use “graph_objects as go” again???

I have done a lot of Googling the past 2 days and not been able to find a solution to this problem.

Thanks.