On Thu, Sep 9, 2010 at 12:52 AM, oekopez <[email protected]> wrote: >>On Wed, Sep 8, 2010 at 2:32 AM, <[email protected]> wrote: >>> Dear Shapely-Developers, >>> >>> First: thank you for Shapely! >>> I have to install Shapely on a cluster (scientific linux), where i don't > have root privilegs. Python, as well as libgeos_c are installed (from > source) under $HOME/local/lib and $HOME/local/bin. The first is in > $LD_LIBRARY_PATH and the latter in $PATH. Unfortunatly ctypes.find_library > seems to fail under these circumstances. Can you fix geos.py to fall back to > the any *nix variant, for loading libgeos_c, if find_library does not find > the library? >>> >>> A possible solution (working for me) could be changing line 28-32 in > geos.py to (inspired by your code line 83-92): >>> >>> if sys.platform == 'linux2': >>> lib = find_library('geos_c') >>> if lib is None: >>> try: >>> _lgeos = CDLL('libgeos_c.so.1') >>> except (OSError, ImportError): >>> _lgeos = CDLL('libgeos_c.so') >>> except: >>> raise >>> else: >>> _lgeos = CDLL(lib) >>> free = CDLL(find_library('c')).free >>> free.argtypes = [c_void_p] >>> free.restype = None >>> >>> >>> Thank you, >>> >>> Philipp >> >>Hi Philipp, >> >>You are very welcome! I'm glad you like it. >> >>I won't rule out the change you suggested, but first I'd like to make >>sure that we can't solve this by sorting your library path. I am >>routinely testing and deploying Shapely using zc.buildout and >>modifying LD_LIBRARY_PATH so that Shapely (in a virtualenv) can find a >>specific, local libgeos_c.so (also built from source). Without any >>root privileges or system-wide installs. Can you check that >>$HOME/local/lib and $HOME/local/bin are at the head of LD_LIBRARY_PATH >>and PATH? >> >>Cheers, >> >>-- >>Sean >> >> > Dear Sean, > thank you for your prompt answer. > I checked the paths, but since I'm not a Linux-pro I attach some output > (variables, errormsg's, tests). However, it may always happen, for different > resaons, that find_library fails (e.g. geos missing). Some kind of error > handling with a clear error message (like "libgeos_c not found") might be > nice anyway. > The system I am using is a commercial cluster system with scientific linux > 5.5. > > So here's my environment: > > [gh1...@skylla1 ~]$ echo $PATH > /home/gh1961/local/lib:/home/gh1961/local/bin:/cm/shared/apps/gcc/4.3.4/bin: > /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/cm/shared/ap > ps/mvapich2/gcc/64/1.2/bin:/cm/shared/apps/mvapich2/gcc/64/1.2/sbin:/home/gh > 1961/bin > [gh1...@skylla1 ~]$ echo $LD_LIBRARY_PATH > /home/gh1961/local/bin:/cm/shared/apps/gcc/4.3.4/lib:/cm/shared/apps/gcc/4.3 > .4/lib64:/cm/shared/apps/mvapich2/gcc/64/1.2/lib > [gh1...@skylla1 ~]$ >
Thanks for printing out those env vars. You need /home/gh1961/local/lib at the start of LD_LIBRARY_PATH and /home/gh1961/local/bin at the start of PATH. You have them reversed. Good idea about raising something other than AttributeError. Cheers, -- Sean _______________________________________________ Community mailing list [email protected] http://lists.gispython.org/mailman/listinfo/community
