ImportError: Unresolved symbol
M.-A. Lemburg
mal at lemburg.com
Wed Jul 21 13:29:47 EDT 1999
More information about the Python-list mailing list
Wed Jul 21 13:29:47 EDT 1999
- Previous message (by thread): ImportError: Unresolved symbol
- Next message (by thread): ImportError: Unresolved symbol
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nikolas Kauer wrote:
>
> When I run a Python CGI script (first line #!/patjh/bin/python), I get the
> following error in the Apache error log:
>
> [Tue Jul 20 16:58:55 1999] [error] [client ...] Premature end of script headers: /usr/share/test/apache_1.3.6/cgi-bin/db_
> driver.cgi
> Traceback (innermost last):
> File "/usr/share/test/apache_1.3.6/cgi-bin/db_driver.cgi", line 24, in ?
> from cgi_namespace import *
> File "/usr/share/test/python/lib/python1.5/lib-dynload/cgi_namespace.py", line 8, in ?
> from cgi_state import State
> File "/usr/share/test/python/lib/python1.5/lib-dynload/cgi_state.py", line 1, in ?
> import types, DateTime, string
> File "/usr/share/test/python/lib/python1.5/lib-dynload/DateTime.py", line 8, in ?
> from mxDateTime import *
> ImportError: Unresolved symbol in /usr/share/test/python/lib/python1.5/lib-dynload/mxDateTime.so: timegm
>
> When I start an interactive Python session, and do "import DateTime", or execute the Python script on
> the command line (like tcsh> ./db_driver.cgi) no error messages appear, everything seems to work fine.
> The Web server runs on Digital Unix 4.0E.
>
> The only solution I can currently think of would be to try to statically link mxDateTime.so ...
Looks like you are using a different LIB path for CGIs and
your interactive sessions. Here's a snippet from my mxODBC
page about CGI and shared libs:
Running mxODBC from a CGI script
ODBC drivers and managers are usually compiled as a shared library. When running CGI scripts
most HTTP daemons (aka web servers) don't pass through the path for the dynamic loader (e.g.
LD_LIBRARY_PATH) to the script, thus importing the mxODBC C extension will fail with unresolved
symbols because the loader doesn't find the ODBC driver/manager's libs.
To have the loader find the path to those shared libs you can either wrap the Python script with a shell
script that sets the path according to your system configuration or tell the HTTP daemon to set or
pass these through (see the daemon's documentation for information on how to do this; for Apache
the directives are named SetEnv and PassEnv).
Note that you can also turn off the timegm API usage
by editing the Setup file in DateTime/mxDateTime and
recompiling the package.
Hope that helps.
--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: 163 days left
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
- Previous message (by thread): ImportError: Unresolved symbol
- Next message (by thread): ImportError: Unresolved symbol
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list