[Qgis-user] cannot connect to X server

devquestions2 at gmail.com devquestions2 at gmail.com
Tue Dec 9 03:39:33 PST 2014


I am seeing the error "cannot connect to X server" in a stand alone python
application at 
"app = QgsApplication([], True)". 

As suggested in the mailing archives I tried setting DISPLAY env varable to
"", but that does not resolve the problem. Would be a great help if you can
point me any references on the issue or have any suggestions on what i can
try. 

Os Ubuntu

code :

import os
import sys

#qgisprefix = '/usr'
qgisprefix='/usr/share/qgis/resources'


os.environ['DISPLAY']=""
from qgis.core import *

from qgis.gui import *

# configure QGIS paths
QgsApplication.setPrefixPath(qgisprefix, True)

# initalise QGIS
QgsApplication.initQgis()

app = QgsApplication([], True)






--
View this message in context: http://osgeo-org.1560.x6.nabble.com/cannot-connect-to-X-server-tp5177010.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list