[Qgis-developer] Error : cannot connect to X server on Ubuntu

Ziegler Stefan Stefan.Ziegler at bd.so.ch
Tue Dec 9 08:23:02 PST 2014


I think there are two approaches:

1) Install Xvfb and start it with the following command (and export DISPLAY): 

Xvfb :99 -ac -noreset &
export DISPLAY=:99

2) Try to use QCoreApplication instead of QApplication:

app = QApplication(sys.argv)
QgsApplication.setPrefixPath("/home/stefan/Apps/qgis_master", True)

I don't know what the drawbacks are when using QCoreApplication.


> -----Ursprüngliche Nachricht-----
> Von: qgis-developer-bounces at lists.osgeo.org [mailto:qgis-developer-
> bounces at lists.osgeo.org] Im Auftrag von devquestions2 at gmail.com
> Gesendet: Dienstag, 9. Dezember 2014 17:12
> An: qgis-developer at lists.osgeo.org
> Betreff: Re: [Qgis-developer] Error : cannot connect to X server on Ubuntu
> >>on X-server,
> I want to run it in a headless mode i.e no GUI. I want to be able to invoke in batch
> mode ( ie headless standalone)  a model developed via graphical modelling tool of qgis.
> So, ideally i dont want to connect to x-server
> this is needed for automation purpose.
> Cant really use python consol from qgis.
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-cannot-
> connect-to-X-server-on-Ubuntu-tp5177029p5177061.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

More information about the Qgis-developer mailing list