conda update spyder
(or pip
, if not using Anaconda)jupyter qtconsole
(if console-related)spyder --reset
I'm attempting to use Spyder on a remote Linux server by SSH and X11 forwarding (Windows 10, PuTTY, VcXsrv).
Launch spyder (% spyder
), splash screen appears, and spyder windows is black and unusable.
Only windows title bar exists to close it.
and PuTTY terminal displays following:
% spyder
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context
QQuickWidget: Failed to make context current
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context
QQuickWidget: Failed to make context current
QQuickWidget: Attempted to render scene with no context
QQuickWidget: Attempted to render scene with no context
composeAndFlush: makeCurrent() failed
Believe issue is related to Qt/PyQt (5.9.4/5.9.2) versions.
Since same 3.3.0 version of Spyder, but older Qt/PyQt (5.6.2/5.6) will work.
More details below.
May be somewhat related to #7152 and #6968
% spyder
)Spyder 3.2.8 bundled with Anaconda 5.2 also has same problem
Splash screen appears, and then normal spyder app window.
Instead, splash screen appears, and spyder app window is all black.
(Able to provide from a local Linux login session, not over ssh/X11)
IPython >=4.0 : 6.4.0 (OK)
cython >=0.21 : 0.28.2 (OK)
jedi >=0.9.0 : 0.12.0 (OK)
matplotlib >=2.0.0: 2.2.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.14.3 (OK)
pandas >=0.13.1 : 0.23.0 (OK)
psutil >=0.3 : 5.4.5 (OK)
pycodestyle >=2.3 : 2.4.0 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.8.4 (OK)
qtconsole >=4.2.0 : 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.7.4 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
Installing spyder from conda-forge uses older Qt/PyQt versions that work:
conda create -n spycf -c conda-forge spyder=3.3.0 python=3.6
conda create -n spy328cf -c conda-forge spyder=3.2.8 python=3.6
Believe issue is related to Qt/PyQt (5.9.4/5.9.2) versions.
Yes, it is, so it's not a Spyder problem. You have two options:
That's unfortunate, but at least a work around for the near term. Thanks.
Looks like a Qt regression to me.
Posted in Qt Forum to start:
https://forum.qt.io/topic/92664/display-issue-with-qt-application-windows-over-ssh-x11
If anyone is interested, these pyqt5 examples also have similar display issues over ssh+x11:
https://github.com/baoboa/pyqt5/tree/master/examples/opengl
Can confirm that Spyder 3.3.0 crashes with various OpenGL errors as referenced in #7152 unless Qt is downgraded to 5.6:
conda install qt=5.6* pyqt=5.6*
Windows gets "Could not Initialize GLX", while macOS gets "Unrecognized OpenGL version".
@bscipio, please let me know if I can provide you with any debugging info if you are going to bring this to the attention of the Qt maintainers.
I started a thread here: http://lists.qt-project.org/pipermail/interest/2018-July/030460.html
as recommended by someone at forum.qt.io. Haven't seen much response there.
It might be better to add to https://bugreports.qt.io/projects/QTBUG/issues/
and to point out the provided pyqt5/opengl examples fail from:
@arnonerba It would be good to know if those examples fail for you too.
Qt Creator has similar bugs when used over ssh + X11.
Another with similar sounding behavior:
https://bugreports.qt.io/browse/QTBUG-68449
Interesting. It looks like I can't launch Qt Creator over SSH to run the demos. It fails with the same "Unrecognized OpenGL version" error.
I'll keep an eye on the open bug reports.
FYI
Rstudio was found to have a very similar issue.
But has configuration options to use software rendering, and can be set via .ini file.
I'm not sure if similar configuration options are theoretically possible additions to spyder. Assuming they'd help.
Ok, thanks a lot for this pointer. We'll try to use the same options in Spyder.
@bscipio, I implemented your suggestion in PR #7700.
And it'll be available since our 3.3.2 version.
Thanks @ccordoba12
Though sorry to say that I'm still having the same errors occur with #7700
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context
I did test RStudio 1.2.907 with "software" set and it did display ok (Otherwise same error). So something unique to Spyder is going on.
What I tried - hopefully not user error:
Download .zip and extract:
https://github.com/spyder-ide/spyder/tree/d5d39de3b190784c954dd04741d0d41c97f5b6c3
% conda create -n spytest spyder
% conda activate spytest
% conda remove spyder
# goto d5d39d spyder folder
# from Putty SSH+X11 Forwarding session with VcXsrv 1.20.0.1
% python bootstrap.py -- --opengl=software
Executing Spyder from source checkout
Revision None, Branch: None
01. Patched sys.path with /home/user/Downloads/spyder-d5d39de3b190784c954dd04741d0d41c97f5b6c3
02. PyQt5 is detected, selecting
03. Imported Spyder 3.3.2.dev0
[Python 3.7.0 64bits, Qt 5.9.6, PyQt5 5.9.2 on Linux]
04. Running Spyder
Bootstrap completed in 00:00:00.3885
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
QQuickWidget: Failed to make context current
QQuickWidget::resizeEvent() no OpenGL context
Tested on CentOS 7 server, Intel graphics.
FYI:
% LIBGL_ALWAYS_INDIRECT=1 python bootstrap.py -- --opengl=software
Can get rid of 2 "libGL error" messages, but otherwise same result.
Running spyder locally I was able to see the new "rendering engine" preference.
@ccordoba12
I looked more closely at rstudio, and found:
https://github.com/rstudio/rstudio/blob/abc216f3ce5ac01ffb0308e88734764e3ab90a2a/src/cpp/desktop/DesktopMain.cpp#L291
So on a hunch I added equivalent lines to: spyder/app/mainwindow.py (starting with commit 900e0e6 )
from PyQt5.QtQuick import QQuickWindow, QSGRendererInterface # New
# Note: I did find not a way to:
# from qtpy.QtQuick import QQuickWindow, QSGRendererInterface
# ~line 3123
if options.opengl_implementation == 'software':
QCoreApplication.setAttribute(Qt.AA_UseSoftwareOpenGL)
QQuickWindow.setSceneGraphBackend(QSGRendererInterface.Software) # New
# and so on for CONF and opengl='desktop'
and then spyder displayed over SSH + X11
when --opengl=software
was used.
These are great news! Thanks @bscipio for digging deep into this one.
I'll prepare a new PR to fix this.
Most helpful comment
Ok, thanks a lot for this pointer. We'll try to use the same options in Spyder.