Spyder: Spyder crashes after I upgraded to 3.2.0 because of OpenGL issues

Created on 26 Jul 2017  路  18Comments  路  Source: spyder-ide/spyder

I just upgraded Spyder to 3.2.0 (Python 3), and it stopped working. Specifically, when I tried launching it at a terminal with spyder, I got the following message:

WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile)) 
Aborted (core dumped)

It seems like a problem stemming from OpenGL? I tried making a fresh virtualenv and just installed spyder and pyqt5, and it still doesn't work...

However, the same works in Python 2.

What steps will reproduce the problem?

  1. mkvirtualenv --python=/usr/bin/python3 testenv
  2. pip install pyqt5 spyder
  3. spyder

Versions and main components

  • Spyder Version: 3.2.0
  • Python Version: 3.5.2
  • Qt Version: 5.9.1
  • PyQt Version: 5.9
  • Operating system: Ubuntu 16.04 LTS
Linux Main Window 1-Critical Bug

All 18 comments

Please post the output of pip freeze when run in your virtualenv.

@ccordoba12 Thanks for the quick response.

Here's the result of pip freeze:

alabaster==0.7.10
astroid==1.5.3
Babel==2.4.0
bleach==2.0.0
certifi==2017.4.17
chardet==3.0.4
decorator==4.1.2
docutils==0.13.1
entrypoints==0.2.3
html5lib==0.999999999
idna==2.5
imagesize==0.7.1
ipykernel==4.6.1
ipython==6.1.0
ipython-genutils==0.2.0
isort==4.2.15
jedi==0.10.2
Jinja2==2.9.6
jsonschema==2.6.0
jupyter-client==5.1.0
jupyter-core==4.3.0
lazy-object-proxy==1.3.1
MarkupSafe==1.0
mccabe==0.6.1
mistune==0.7.4
nbconvert==5.2.1
nbformat==4.3.0
numpydoc==0.7.0
pandocfilters==1.4.1
pexpect==4.2.1
pickleshare==0.7.4
pkg-resources==0.0.0
prompt-toolkit==1.0.14
psutil==5.2.2
ptyprocess==0.5.2
pycodestyle==2.3.1
pyflakes==1.5.0
Pygments==2.2.0
pylint==1.7.2
PyOpenGL==3.1.0
PyQt5==5.9
python-dateutil==2.6.1
pytz==2017.2
pyzmq==16.0.2
QtAwesome==0.4.4
qtconsole==4.3.0
QtPy==1.2.1
requests==2.18.2
rope==0.10.5
simplegeneric==0.8.1
sip==4.19.3
six==1.10.0
snowballstemmer==1.2.1
Sphinx==1.6.3
sphinxcontrib-websupport==1.0.1
spyder==3.2.0
testpath==0.3.1
tornado==4.5.1
traitlets==4.3.2
urllib3==1.22
wcwidth==0.1.7
webencodings==0.5.1
wrapt==1.10.10

@kuo000 it might be something related to PyQt5==5.9

This is bug in Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/qtbase-opensource-src/+bug/1590737

so I'm sorry, but there's nothing we can about it in our side.


You can find a possible solution here:

https://forum.qt.io/topic/74998/failed-to-create-opengl-context-for-format-qsurfaceformat-in-qt-5-6-0

but I really don't know what's meant for it.

@ccordoba12 Understood.

Thanks for taking the time to investigate this!

This is now happening (all of a sudden) on a previously working install, after updating matplotlib. I cannot make spyder load any more:

QApplication: invalid style override passed, ignoring it.
WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile)) 
Aborted

Actually, it does this now even when I do a fresh install of miniconda with

conda install nomkl numpy scipy matplotlib pyqtgraph spyder pyopengl

Spyder crashes with the above output. I'm on Linux Mint 18.3.

Regards,
Jack

@jaxankey, it looks like a bug with the Nvidia drivers, so you should switch to use your Intel card instead.

No idea how you know that, but thank you! I changed from nvidia-390.59 to nvidia-396.24 in Mint's driver manager, and it works now.

Strange that it _suddenly_ happened like this, but glad it's fixed!

Thanks again,
Jack

No idea how you know that, but thank you!

Well, it was reported in the Ubuntu bug I linked above :-)

@ccordoba12 Hi, I have the same pb.

Which version of spyder can I downgrade to, to make spyder work back again ?

@ccordoba12 I also this error before the Failed to create OpenGL context message :

AttributeError: '_ModuleMock' object has no attribute 'PLUGIN_CLASS'

Any idea ?

@luolitao Hi, can please reopen because mine is not solved, here is what I did :

conda update qt pyqt spyder and I still get :

$ spyder &
[1] 31885
$
 WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed.
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))

[1]+  Aborted                 (core dumped) spyder

@sebma, there's nothing we can do about this in Spyder because it's a problem with your graphic card drivers.

So please update them or use your Intel card instead of your Nvidia one, and try again.

As For Me, i just
conda install pyqt=4
and then conda install tensorflow-gpu (something you need, which will install pyqt5 automaticly)
thing goes well now, maybe it just because i miss something when i install spyder

and then conda install tensorflow-gpu (something you need, which will install pyqt5 automaticly)

This is not true (I tried both with conda and pip and neither brings pyqt5).

@Magicwangs Thanks a ton! It worked! :)

Was this page helpful?
0 / 5 - 0 ratings