I also had the same problem when I run spyder or anaconda-navigator. I have tried many solutions suggested, but only Khoward's solution above helped me. It is as below.
export QT_XCB_GL_INTEGRATION=none
The problem is that when I reboot my ubuntu, I had to run the script above again. So, I opened
nano ~/.bashrc
and added the line below at the bottom of the file.
export QT_XCB_GL_INTEGRATION=none
Saved the file(Ctl+x).
And rebooted and running spyder and anaconda-navigator was ok. I think it was the problem caused by between QT and OpenGL.