xdata-skylark / libskylark

Sketching-based Distributed Matrix Computations for Machine Learning
Other
98 stars 20 forks source link

QXcbConnection: Could not connect to display #63

Closed gidiko closed 7 years ago

gidiko commented 7 years ago

When playing with the libskylark as installed by the installer script I get:

[gkollias@dccxl002 ~]$ ipython
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import El

In [2]: QXcbConnection: Could not connect to display
Aborted (core dumped)
gidiko commented 7 years ago

A work-around with an environment variable: QT_QPA_PLATFORM=offscreen from https://github.com/ariya/phantomjs/issues/14376

[gkollias@dccxl002 ~]$ QT_QPA_PLATFORM=offscreen ipython
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import El

In [2]:

Looking around for something more transparent...

gidiko commented 7 years ago

Another workaround... choose the Agg backend... before importing El from https://github.com/ContinuumIO/anaconda-issues/issues/1215

[gkollias@dccxl002 ~]$ ipython
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import matplotlib; matplotlib.use('Agg')

In [2]: import El

In [3]:
gidiko commented 7 years ago

OK... in lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc changing to backend : Agg from backend : Qt5Agg also does the trick... but how do we enforce it as default?

poulson commented 7 years ago

You may just want to use a version of Elemental compiled without Qt5. The python visualization is much better than the Qt5 viz.

poulson commented 7 years ago

Passing in the command-line flag -no-gui might also fix this.

gidiko commented 7 years ago

Constraining to use Qt4 (instead of Qt5) in conda builds also does the trick:

Add pyqt >=4,<5 in requirements/run section of meta.yaml of the recipe