Ticket #155 (closed task: fixed)

Opened 7 years ago

Last modified 7 years ago

Unable to run Python service when stored in nested directories

Reported by: surf9 Owned by:
Priority: trivial Milestone:
Component: Development platform Version:
Keywords: Cc:

Description

Hi there

I am able to run my python service if store files in root directory of cgi-bin directory. However, when I store the files in nested folders it is not able to run the service.

GetCapability? output is:

<wps:Process wps:processVersion="2"><ows:Identifier>python.wfs.geoValidationMainlandWFSPy</ows:Identifier><ows:Title>Python WFS</ows:Title><ows:Abstract>Python WFS</ows:Abstract><ows:Metadata xlink:title="Demo"/></wps:Process>

Executing service from cgi-bin root directory has the following output:

./zoo_loader.cgi "ServiceProvider?=&metapath=&Service=WPS&Request=Execute&Version=1.0.0&Identifier=python.wfs.geoValidationMainlandWFSPy&DataInputs?=lat=-40.344985;long=175.670925"

Content-Type: text/xml; charset=utf-8

Status: 501 Not Implemented

<?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 geoValidationMainlandWFSPy cannot be loaded. Message: TRACE: No module named python.wfs.geoValidationMainlandWFSPy

&lt;type 'exceptions.ImportError?'&gt; </ows:ExceptionText>

</ows:Exception>

</ows:ExceptionReport>

Putting files in nested directories works in JS and Java.

Change History

Changed 7 years ago by djay

Hello, when you use a subdirectory to store your Python services, then you need to also add a __init__.py file in the same directory for the module to be found.

Changed 7 years ago by surf9

Thanks. That resolved my issue.

Changed 7 years ago by djay

  • status changed from new to closed
  • resolution set to fixed

So we can close this issue.

Note: See TracTickets for help on using tickets.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png