[Zoo-discuss] Zoo kernel not loading Python services

Fenoy Gerald gerald.fenoy at geolabs.fr
Tue Jul 12 03:07:51 PDT 2016


Hello,
I suppose that you have set the value « test.py » in your zcfg file for the serviceProvider. Nevertheless, it is not require to write the extension .py to the python module to be loaded. So you should use test rather than test.py to solve your issue.

In case you have a subdirectory named test, then you may try adding a __init__.py file to make the ZOO-Kernel able to find the py module located in the test subdirectory.

I hope it helps and yo can confirm that your issue is solved.

Best regards,
 
> Le 11 juil. 2016 à 08:31, Balajee R.C <balajee at vizexperts.com> a écrit :
> 
> I have built zoo from svn (rev. 784) with --with-python enabled. I am using Python version: 2.7.5
> 
> I have the following Python based service:
> 
> import zoo
> def test(conf, inputs, outputs):
>    outputs["output"]["value"] = "Hello from Python World !"
>    return 3
> 
> When I execute the above service, I get the following error:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" xml:lang="en-US" version="1.1.0">
>     <ows:Exception exceptionCode="NoApplicableCode">
>         <ows:ExceptionText>Python module test.py cannot be loaded. Message: TRACE: No module named py
> <type 'exceptions.ImportError'>
> </ows:ExceptionText>
>     </ows:Exception>
> </ows:ExceptionReport>
> 
>  However, I do notice that they pyc file for my service test.py file HAS indeed been created. Hence, it appears that the trouble is that there is another module named py that it is trying to load.
> 
> I have already done pip install py for my python installation. When I launch my python interpreter directly and do:
> 
> import py
> 
> then this works without an error.
> 
> What could be going wrong? Can someone please point me in the right direction?
> 
> Regards,
> Balajee.R.C 
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/zoo-discuss



Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay



More information about the Zoo-discuss mailing list