python – Error using the pandas.DataFrame.to_clipboard in Ubuntu

I am having trouble using the .to_clipboard() of the dataframe class in Ubuntu 20.04.1 LTS. The error I get is QXcbClipboard::setMimeData: Cannot set X11 selection owner.

sample code:

import pandas as pd

t = {'a' : (1,2,3), 'b' : (4,5,6)}

t
Out(37): {'a': (1, 2, 3), 'b': (4, 5, 6)}

pd.DataFrame(t)
Out(38): 
   a  b
0  1  4
1  2  5
2  3  6

pd.DataFrame(t).to_clipboard()
QXcbClipboard::setMimeData: Cannot set X11 selection owner

The dataframe does not copy into the clipboard. Does anyone have advice on how to resolve this? Please keep in mind that I am fairly new to Ubuntu.

Thanks in advance.