Skip to content

Print a helpful warning when using x.plot and DISPLAY is not set #211

Description

@jypeter

@charlesdoutriaux It's quite hard (the first time you get the error) to understand what is happening, when you use x.plot and there is no DISPLAY. Especially since it completely crashes python!

bash-4.1$ echo $DISPLAY
localhost:10.0
bash-4.1$ unset DISPLAY
bash-4.1$ echo $DISPLAY

bash-4.1$ source activate cdatm14
(cdatm14) bash-4.1$ python
Python 2.7.12 | packaged by conda-forge | (default, Feb  9 2017, 14:36:30)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import vcs, numpy as np
>>> x = vcs.init()
>>> i = np.identity(10)
>>> x.plot(i)
ERROR: In /export/doutriaux1/anaconda2/conda-bld/vtk-cdat_1479230506328/work/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 1475
vtkXOpenGLRenderWindow (0x223c960): bad X server connection. DISPLAY=Aborted (core dumped)
(cdatm14) bash-4.1$

Can you print an error message and make this more user friendly? Maybe this has already been addressed in 2.10, but I'm still running 2.8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions