<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Cheers Josh,<br><br>FYI as another work around I just set the environment variables in the script...<br><br>from os import environ<br>import numpy<br><br> envarg = environ.copy()<br> envarg["DISPLAY"] = ":0.0"<br> cmd = 'glxinfo'<br> run = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=envarg)<br><br>Thanks,<br><br>J.<br><br>> Subject: Re: [ome-devel] Scripts / Environment Variables / OpenGL...<br>> From: josh@glencoesoftware.com<br>> Date: Wed, 26 Jan 2011 19:15:26 +0100<br>> CC: ome-devel@lists.openmicroscopy.org.uk<br>> To: jeromeavondo@msn.com<br>> <br>> Hi Jerome,<br>> <br>> The entire environment from the running user is not copied into the subprocess. If you would like to workaround for the moment see:<br>> https://trac.openmicroscopy.org.uk/omero/browser/ome.git/components/tools/OmeroPy/src/omero/processor.py#L127<br>> We can discuss the implementation under:<br>> http://trac.openmicroscopy.org.uk/omero/ticket/4027<br>> <br>> Cheers,<br>> ~Josh<br>> <br>> <br>> On Jan 26, 2011, at 6:46 PM, Jerome Avondo wrote:<br>> <br>> > <br>> > Hi all,<br>> > <br>> > I have the following problem,<br>> > <br>> > I have OMERO 4.2.1 installed on a linux box, fedora core 12.<br>> > I have a user called omero on the box, who starts/runs omero,<br>> > The user omero also has the ~/.bashrc file setup to contain,<br>> > <br>> > export DISPLAY =:0.0<br>> > <br>> > such that I can have access to the xserver for stuff like OpenGL applications. <br>> > So when I'm logged in as omero, I can run glxinfo etc etc ... <br>> > All works fine from terminal...<br>> > <br>> > But when I try to run a server side script from OMERO.insight, and do something simple like (note some code removed for simplicity sake):<br>> > <br>> > import subprocess<br>> > <br>> > def doSomething():<br>> > <br>> > cmd = "glxinfo"<br>> > run = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)<br>> > <br>> > returncode = run.wait()<br>> > <br>> > stdout = run.stdout.readlines()<br>> > stderr = run.stderr.readlines() <br>> > log("stdout: %s stderr: %s" % (stdout,stderr) )<br>> > <br>> > I get an error back saying "Error: unable to open display". Which would lead me to believe that the DISPLAY environment variable is not specified no?<br>> > The omero python scripts should be executed as the omero user no? So how come the DISPLAY variables seems to have gotten lost?<br>> > <br>> > Any help appreciated as useal...<br>> > Thanks,<br>> > <br>> > Jerome.<br>> > <br>> <br>                                            </body>
</html>