[Qgis-developer] Error : cannot connect to X server on Ubuntu
devquestions2 at gmail.com
devquestions2 at gmail.com
Tue Dec 9 05:16:25 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 variable 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)
Thanks !
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Error-cannot-connect-to-X-server-on-Ubuntu-tp5177029.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
More information about the Qgis-developer
mailing list