Harasty:

On Linux or Mac you would have to specify $LD_LIBRARY_PATH to include the
path to the folder with your native library if it is installed in an
unusual place. I have no idea if it'll work for windows. One way to check
if your fiddling with the env variables actually has an effect, you could
output the values inside of your python script like so:
   import os
   print os.environ #this is a dictionary of env variables

HTH

Cheers

--
Oleksandr (Sasha) Huziy




2013/7/16 Harasty, Daniel J <dhara...@appcomsci.com>

> I realize that – strictly speaking – this is probably not a bug in
> Shapely, but I would appreciate any advice.****
>
> ** **
>
> I’d like to use Shapely in this environment:****
>
> ** **
>
> **·         **In a Python script implementing a WSGI application****
>
> **·         **Deployed on Windows behind Apache httpd 2.x****
>
> ** **
>
> Alas, I get this error logged by Apache:****
>
> ** **
>
> **·         **WindowsError: [Error 126] The specified module could not be
> found****
>
> ** **
>
> The traceback reveals a problem loading the “geos_c.dll”:****
>
> ** **
>
> File "C:\\Python\\Python26\\lib\\site-packages\\shapely\\geos.py", line
> 76, in <module>****
>
>     _lgeos = CDLL("geos_c.dll") # DJH****
>
> File "C:\\Python\\Python26\\lib\\ctypes\\__init__.py", line 354, in
> __init__****
>
>     self._handle = _dlopen(self._name, mode)****
>
> ** **
>
> This is thrown immediately upon “import shapely.wkb”, or any other Shapely
> library that imports shapely.geos.****
>
> ** **
>
> This has the smell of some sort of “path problem”, but I have fiddled with
> every possible PATH and PYTHONPATH setting both inside and outside of
> Apache.****
>
> ** **
>
> I can repeat this in a diminutive app (not only my larger application),
> which shows that even loading nothing else, I can trip this error.  I’d be
> willing to post/share my sample code and fragment from my Apache conf… but
> you’d have to already have some familiarity with Apache and Python WSGI on
> Windows for it to mean much.****
>
> ** **
>
> Note that calling similar script (using Shapely) as a CGI (behind Apache)
> work fine.  So this sounds like a DLL loading problem peculiar to
> Windows+Apache+mod_wsgi.  (Not a Shapely or geos_c.dll bug, per se.)
> However, none of my other Python+WSGI+Window+Apache scripts are having the
> same problem.****
>
> ** **
>
> Any advice?****
>
> ** **
>
> Thanks,****
>
> ** **
>
> Dan Harasty****
>
> dhara...@appcomsci.com****
>
> ** **
>
> ** **
>
> _______________________________________________
> Community mailing list
> Community@lists.gispython.org
> http://lists.gispython.org/mailman/listinfo/community
>
>
_______________________________________________
Community mailing list
Community@lists.gispython.org
http://lists.gispython.org/mailman/listinfo/community

Reply via email to