[ome-devel] omero 4.0.3: omeroPy problem

Josh Moore josh.moore at gmx.de
Wed Jun 23 12:16:46 BST 2010


On 6/23/10 11:23 AM, b.gerritsen at nki.nl wrote:
> Dear all,
>
> When building omero 4.0.3 on Ubuntu 10.04 I get a supposedly successful build, but no python (".py") files in the "dist/lib/python/" folder. Included in the attachment is the build log
>    

This is most likely the same problem as #1334[1]. You might make the 
same changes as in r4426[2] to see.

> I have naively tried to copy the python files from "components/tools/OmeroPy/target/" to the "dist/lib/python/" folder. This partially solves the problem, but I cannot create a gateway as shown below:
>
> PYTHONPATH=. python
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>    
>>>> import omero
>>>> c = omero.client('wooki')
>>>> s = c.createSession('root', 'ome')
>>>> g = s.createGateway()
>>>>          
> Traceback (most recent call last):
>    File "<stdin>", line 1, in<module>
>    File "omero_API_ice.py", line 4387, in createGateway
>      return _M_omero.api.ServiceFactory._op_createGateway.invoke(self, ((), _ctx))
> RuntimeError: class ::omero::api::GatewayPrx is declared but not defined
>    
>>>>          
> The above problem remains, even when setting the pythonpath to the "dist/lib/python/" of a copy of omero 4.0.3 from another computer where the build DID produce python files in "dist/lib/python/". Could someone tell me what might be the problem?
>    

This is an issue with forward-declarations in Ice. Use:

import omero
import omero_api_Gateway_ice
c = omero.client(...
s = c.createSession(...
g = s.createGateway()

> Kind Regards,
> Bram
>
> PS:
> As opposed to omero 4.0.3, the following python code does work for an omero 4.2 build on the very same system:
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>    
>>>> import omero
>>>> c = omero.client('localhost')
>>>> s = c.createSession('root', 'ome')
>>>> g = s.createGateway()
>>>>          

Right. You can see in OmeroPy/src/omero/all.py[3] that in newer versions 
the library does that importing for you.

Cheers,
~Josh.


[1]https://trac.openmicroscopy.org.uk/omero/ticket/1344
[2]https://trac.openmicroscopy.org.uk/omero/changeset/4426
[3]https://trac.openmicroscopy.org.uk/omero/browser/trunk/components/tools/OmeroPy/src/omero/all.py



More information about the ome-devel mailing list