On 22 July 2011 06:33, [email protected] <[email protected]> wrote: > I tried this to see if it would solve the problem with no success; no > change in error message. > ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not > found, and no default driver specified (0) (SQLDriverConnectW)') > > def fix_environment(): > os.environ['LD_LIBRARY_PATH'] ='/opt/sqlanywhere12/lib32'
You can't set this on in WSGI script file as is too late. This variable needs to be set at time process starts up. If you have a standard Apache installation, then look for the 'envvars' file in same directory as Apache 'httpd' executable and add to the 'envvars' file: LD_LIBRARY_PATH='/opt/sqlanywhere12/lib32':$LD_LIBRARY_PATH export LD_LIBRARY_PATH Alternatively, if you compiled the Python client module for pyodbc yourself, then we can set an environment variable at the time you compile it so the library directory is embedded in the client module and therefore don't need to set it at run time. > os.environ['PATH'] =os.environ['PATH']+':/opt/sqlanywhere12/ > bin32:/usr/local/sbin:/usr/local/bin:/usr/bin:/root/bin' Not usually a good idea for a web application to be overriding PATH. Code shouldn't be relying on picking up executables to be run from PATH but should use absolute paths instead. In all probability this isn't needed anyway, as code probably not trying to execute command line applications. > os.environ['SQLANY12'] ='/opt/sqlanywhere12' > os.environ['SQLANYSAMP12'] ='/opt/sqlanywhere12/samples' These are okay set like that. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
