[Qgis-developer] PyQGIS standalone without x server

Martin Dobias wonder.sk at gmail.com
Tue Oct 28 03:55:50 PDT 2014


Hi Stefan

On Tue, Oct 28, 2014 at 5:47 PM, Ziegler Stefan <Stefan.Ziegler at bd.so.ch> wrote:
>
> Since I do not have access to a server w/o x server I cannot test it by myself. Does anybody know if a running x server is required to run pyqgis standalone apps? E.g. something like this:
>
> app = QApplication(sys.argv)

The X server is required here. QApplication will try to make a
connection to it. QCoreApplication does not - but it brings other
limitations.

Actually there is an easy way to try it out - just set DISPLAY env
variable to nothing:

martin at zenbook:~$ DISPLAY="" python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4 import QtGui
>>> app = QtGui.QApplication([])
: cannot connect to X server

(the process is aborted)

Cheers
Martin


More information about the Qgis-developer mailing list