Re: Dynamic Loading - Help wanted

Guido.van.Rossum@cwi.nl
Thu, 09 Mar 1995 14:46:51 +0100

> I'm working on a SunOS 4.1.3 system and I'd like to know
> how to "turn on" the dynamic loading feature.
>
> I get the following error from make:
>
> ------------------------------------------------------
>
> PYTHONPATH=/usr7/user/sst/lib/python \
> ./python /usr7/user/sst/lib/python/compileall.py /usr7/user/sst/lib/python
> Traceback (innermost last):
> File "/usr7/user/sst/lib/python/compileall.py", line 8, in ?
> import os
> File "/usr7/user/sst/lib/python/os.py", line 46, in ?
> raise ImportError, 'no os specific module found'
> ImportError: no os specific module found
> *** Error code 1
> make: Fatal error: Command failed for target `libinstall'

Ahh, you probably made the module "posix" dynamically loadable. This
means that it's no longer in sys.builtin_module_names, which means
that module "os" thinks it can't be imported. (OK, maybe a bit
stupid, but that's the way it is for now.) In the 1.2-beta version of
Modules/Setup, the following fragment exists:

======================================================================
# If you want to build most modules as shared libraries, here are
# a couple of lines to enable. The modules listed here can't be
# built as shared libraries for various reasons.
# IF YOU ENABLE THEM HERE, DISABLE THEM LATER IN THE Setup FILE!

#posix posixmodule.c # posix (UNIX) system calls
#signal signalmodule.c # signal(2)
#gl glmodule.c -lgl -lX11 # Graphics Library -- SGI only
#thread threadmodule.c # threads -- see below

# Uncommenting the following line tells makesetup that all following
# modules are to be built as shared libraries (see above for more detail).

#*noconfig*
======================================================================

Basically, it means that any of the modules posix, signal, gl and
thread, if enabled in Setup, must occur *before* the *noconfig* line.

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>