[Zoo-discuss] python module shapely failed to load

Fenoy Gerald gerald.fenoy at geolabs.fr
Sat Nov 28 19:20:57 PST 2015


Hello,
sorry for this issue, I had faced the same before and I had fixed it but I was not able to find it back ...

You should try to modify your local copy of ctypes/util.py file, replace :

f = os.popen('/sbin/ldconfig -p 2>/dev/null’)

by 

import subprocess
f = subprocess.Popen('/sbin/ldconfig -p', shell=True, stdout=subprocess.PIPE).stdout 

This should solve the problem.

Best regards,

> Le 22 sept. 2015 à 21:49, Richárd Kiss <omegatf at gmail.com> a écrit :
> 
> Hi,
> 
> I would like to use shapely in my zoo wps python script.
> It works fine via bash shell (I have installed shapely, and geos) but when executed by zoo-project, I get the following output:
> 
> Python module test_service cannot be loaded.
> Message: TRACE: (10, 'No child processes') <type 'exceptions.IOError'> Unable to run your python process properly. 
> Please check the following messages : [' 
> File "/usr/lib/cgi-bin/test_service.py", line 27, in <module>\n from shapely.wkt import dumps, loads\n', ' 
> File "/usr/lib/python2.7/dist-packages/shapely/wkt.py", line 4, in <module>\n from shapely import geos\n', ' 
> File "/usr/lib/python2.7/dist-packages/shapely/geos.py", line 54, in <module>\n _lgeos = load_dll(\'geos_c\', fallbacks=[\'libgeos_c.so.1\', \'libgeos_c.so\'])\n', ' 
> File "/usr/lib/python2.7/dist-packages/shapely/geos.py", line 37, in load_dll\n lib = find_library(libname)\n', ' 
> File "/usr/lib/python2.7/ctypes/util.py", line 253, in find_library\n return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name))\n', ' 
> File "/usr/lib/python2.7/ctypes/util.py", line 246, in _findSoname_ldconfig\n f.close()\n']
> 
> I use ubuntu 14.04 and zoo version 1.4 and 1.5, and get the same results.
> 
> The test script is very simple derived from the test_service.py:
> 
> import zoo
> from shapely.wkt import dumps, loads
> def HelloPy(conf,inputs,outputs):
> 	outputs["Result"]["value"]=dumps(loads('POINT (0 0)'))
> 	return zoo.SERVICE_SUCCEEDED
> 
> Any idea how to fix this?
> 
> Best regards,
> Richard
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss



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



More information about the Zoo-discuss mailing list