To reproduce
sudo $(which ipython)
import ps_mem
ps_mem.main()
prints to STDOUT the table, but says about STDOUT:
Error in sys.excepthook:
Original exception was:
Using
Kubuntu 18.04
Linux 5.0.x
iPython 7.12.0
python 3.6.9
However, in python 3 default interpreter works without a crash.