warnings during installation of python2.3.1 on SCO_SV 3.2v5.0.5

Discussion in 'Python' started by Roger Erens, Sep 29, 2003.

  1. Roger Erens

    Roger Erens Guest

    Dear list,

    I'm trying to install python2.3.1 on an SCO-box.
    After running ./configure --prefix=/usrdir/rogere
    the output of make shows (among others:)

    running build
    running build_ext
    building 'struct' extension
    creating build
    creating build/temp.sco_sv-3.2-i386-2.3
    cc -DNDEBUG -O -Kpic -belf -belf -Ki486 -DSCO5 -I.
    -I/usrdir/rogere/Python-2.3.1/./Include -I/usrdir/rogere/include
    -I/usrdir/rogere/Python-2.3.1/Include -I/usrdir/rogere/Python-2.3.1 -c
    /usrdir/rogere/Python-2.3.1/Modules/structmodule.c -o
    build/temp.sco_sv-3.2-i386-2.3/structmodule.o
    creating build/lib.sco_sv-3.2-i386-2.3
    cc -Wl,-G,-Bexport build/temp.sco_sv-3.2-i386-2.3/structmodule.o
    -L/usrdir/rogere/lib -L/usr/local/lib -o
    build/lib.sco_sv-3.2-i386-2.3/struct.so
    *** WARNING: importing extension "struct" failed with
    exceptions.AttributeError: 'module' object has no attribute 'load_dynamic'

    I also get lots of these warnings for other extensions, like 'regex',
    'pcre', '_hotshot', etc, etc.
    In the end I can start up the Python interpreter; however, importing one of
    the above extensions fails:

    >python

    Python 2.3.1 (#2, Sep 29 2003, 16:43:28) [C] on sco_sv3
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import regex

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    ImportError: No module named regex

    Does anyone have a clue about how I should resolve these warnings?
    I'd be glad to send any extra needed information if required.

    Best regards and thanks in advance,
    Roger Erens

    > uname -X


    System = SCO_SV
    Node = ontwik2
    Release = 3.2v5.0.5
    KernelID = 98/07/02
    Machine = i80386
    BusType = ISA
    Serial = 5FL004745
    Users = 30-user
    OEM# = 0
    Origin# = 1
    NumCPU = 2

    >ld -V

    SCO UNIX Development System Release 5.1.1A 27Jul98
    395 /usrdir/rogere/Python-2.3.1
    >cc -V

    SCO UNIX Development System Release 5.1.1A 27Jul98
    Roger Erens, Sep 29, 2003
    #1
    1. Advertising

  2. Roger Erens

    Jarek Zgoda Guest

    Roger Erens <> pisze:

    >> uname -X

    >
    > System = SCO_SV
    > Node = ontwik2
    > Release = 3.2v5.0.5
    > KernelID = 98/07/02
    > Machine = i80386
    > BusType = ISA
    > Serial = 5FL004745
    > Users = 30-user
    > OEM# = 0
    > Origin# = 1
    > NumCPU = 2
    >
    >>ld -V

    > SCO UNIX Development System Release 5.1.1A 27Jul98
    > 395 /usrdir/rogere/Python-2.3.1
    >>cc -V

    > SCO UNIX Development System Release 5.1.1A 27Jul98


    I wouldn't be surprised, SCO systems is absolute crap. And they object
    reality.

    http://lwn.net/Articles/51374/

    --
    Jarek Zgoda
    Registered Linux User #-1
    http://www.zgoda.biz/ JID: http://zgoda.jogger.pl/
    Jarek Zgoda, Sep 29, 2003
    #2
    1. Advertising

  3. On Mon, 29 Sep 2003 17:34:20 +0200, Roger Erens wrote:

    > Dear list,
    >
    > I'm trying to install python2.3.1 on an SCO-box.
    > After running ./configure --prefix=/usrdir/rogere
    > the output of make shows (among others:)
    >
    > running build
    > running build_ext
    > building 'struct' extension
    > creating build
    > creating build/temp.sco_sv-3.2-i386-2.3
    > cc -DNDEBUG -O -Kpic -belf -belf -Ki486 -DSCO5 -I.
    > -I/usrdir/rogere/Python-2.3.1/./Include -I/usrdir/rogere/include
    > -I/usrdir/rogere/Python-2.3.1/Include -I/usrdir/rogere/Python-2.3.1 -c
    > /usrdir/rogere/Python-2.3.1/Modules/structmodule.c -o
    > build/temp.sco_sv-3.2-i386-2.3/structmodule.o
    > creating build/lib.sco_sv-3.2-i386-2.3
    > cc -Wl,-G,-Bexport build/temp.sco_sv-3.2-i386-2.3/structmodule.o
    > -L/usrdir/rogere/lib -L/usr/local/lib -o
    > build/lib.sco_sv-3.2-i386-2.3/struct.so
    > *** WARNING: importing extension "struct" failed with
    > exceptions.AttributeError: 'module' object has no attribute 'load_dynamic'
    >
    > I also get lots of these warnings for other extensions, like 'regex',
    > 'pcre', '_hotshot', etc, etc.
    > In the end I can start up the Python interpreter; however, importing one of
    > the above extensions fails:
    >
    >>python

    > Python 2.3.1 (#2, Sep 29 2003, 16:43:28) [C] on sco_sv3
    > Type "help", "copyright", "credits" or "license" for more information.
    >>>> import regex

    > Traceback (most recent call last):
    > File "<stdin>", line 1, in ?
    > ImportError: No module named regex
    >
    > Does anyone have a clue about how I should resolve these warnings?
    > I'd be glad to send any extra needed information if required.
    >
    > Best regards and thanks in advance,
    > Roger Erens
    >
    >> uname -X

    >
    > System = SCO_SV
    > Node = ontwik2
    > Release = 3.2v5.0.5
    > KernelID = 98/07/02
    > Machine = i80386
    > BusType = ISA
    > Serial = 5FL004745
    > Users = 30-user
    > OEM# = 0
    > Origin# = 1
    > NumCPU = 2
    >
    >>ld -V

    > SCO UNIX Development System Release 5.1.1A 27Jul98
    > 395 /usrdir/rogere/Python-2.3.1
    >>cc -V

    > SCO UNIX Development System Release 5.1.1A 27Jul98


    I also have an interest in the answer to this question. I can narrow it
    down to the following:
    1) Python 2.2.2b1 links find on the particular SCO-Machine I am using.
    2) The problem must be somewhere in distutils. Its happening in the run in
    distutils/command/build_ext.py. The routine build_extension is called. I
    built a print right at the beginning of the routine and another one right
    at the end. The warning is coming as it were in the middle of nowhere,
    here is the extract from build_ext.py:

    def build_extensions(self):
    # First, sanity-check the 'extensions' list
    self.check_extensions_list(self.extensions)

    for ext in self.extensions:
    self.build_extension(ext)

    def build_extension(self, ext):
    print "RNS----------------- Begin of Extension ",ext.name

    ....
    self.compiler.link_shared_object(
    objects, ext_filename,
    libraries=self.get_libraries(ext),
    library_dirs=ext.library_dirs,
    runtime_library_dirs=ext.runtime_library_dirs,
    extra_postargs=extra_args,
    export_symbols=self.get_export_symbols(ext),
    debug=self.debug,
    build_temp=self.build_temp,
    target_lang=language)
    print "RNS----------------- End of Extension ",ext.name

    And here is the output:

    sharp@charlie:/u/users/sharp/Python-2.3.1 > make clean
    find . -name '*.o' -exec rm -f {} ';'
    find . -name '*.s[ol]' -exec rm -f {} ';'
    find . -name '*.py[co]' -exec rm -f {} ';'
    sharp@charlie:/u/users/sharp/Python-2.3.1 > ./python -E ./setup.py build
    running build
    running build_ext
    RNS----------------- Begin of Extension regex
    building 'regex' extension
    cc -DNDEBUG -O -Kpic -belf -belf -Ki486 -DSCO5 -I. -I/u/users/sharp/Python-2.3.1
    /./Include -I/usr/local/include -I/u/users/sharp/Python-2.3.1/Include -I/u/users
    /sharp/Python-2.3.1 -c /u/users/sharp/Python-2.3.1/Modules/regexmodule.c -o buil
    d/temp.sco_sv-3.2-i386-2.3/regexmodule.o
    cc -DNDEBUG -O -Kpic -belf -belf -Ki486 -DSCO5 -I. -I/u/users/sharp/Python-2.3.1
    /./Include -I/usr/local/include -I/u/users/sharp/Python-2.3.1/Include -I/u/users
    /sharp/Python-2.3.1 -c /u/users/sharp/Python-2.3.1/Modules/regexpr.c -o build/te
    mp.sco_sv-3.2-i386-2.3/regexpr.o
    UnixCompiler
    cc -Wl,-G,-Bexport build/temp.sco_sv-3.2-i386-2.3/regexmodule.o build/temp.sco_s
    v-3.2-i386-2.3/regexpr.o -L/usr/local/lib -o build/lib.sco_sv-3.2-i386-2.3/regex
    ..so
    UnixCompiler End
    RNS----------------- End of Extension regex
    *** WARNING: importing extension "regex" failed with exceptions.AttributeError:
    'module' object has no attribute 'load_dynamic'
    RNS----------------- Begin of Extension pcre


    Now what is being processed that throws up the warning and why?
    Considering that the commands, if set off on their own, give no warning.

    It is now late in Germany and I am tired and may have missed something
    obvious, but I would also be glad of a hint, since, think what I may of
    SCO, I would greatly prefer to work with the newest version.

    regards,

    Richard Sharp
    Richard Sharp, Oct 2, 2003
    #3
  4. For anyone interested here is the solution to the problem. ./configure is
    not setting HAVE_DYNAMIC_LOADING. This is because libdl.a is not being
    found.
    To keep it short, unless you specify CLFLAG="-b elf", SCO will only search
    for libdl.a and not for libdl.so. libdl.a is not there and then
    HAVE_DYNAMIC_LOADING will not be set. This will lead to a problem in
    setup.py, which subclasses build_extension and, after building the
    library, tries to import it, with imp.load_dynamic(..). If you look at
    Python/import.c, then it is obvious that without HAVE_DYNAMIC_LOADING
    there will be no method load_dynamic and thence the error message.

    So to start - CLFLAG="-b elf";export CLFLAG or the appropriate for your
    shell.

    The other problems you may get are with socketmodule.c.

    1. On my SCO IPv6 is not there. This means ./configure --enable-ipv6=no.

    2. SCO does not supply h_errno and this has to be defined.
    3. INET_ADDRSTRLEN is not defined but required.


    at line 230, the following appears
    # ifndef RISCOS
    # include <fcntl.h>
    # else
    # include <sys/ioctl.h>
    # include <socklib.h>
    # define NO_DUP
    int h_errno; /* not used */
    # define INET_ADDRSTRLEN 16
    # endif

    I just borrowed the two lines below NO_DUP and put them right above the
    first ifndef. It would of course be better to make the definitions
    dependant on SCO.

    At line 2971 we have this:

    #ifndef ENABLE_IPV6
    if(af == AF_INET6) {
    PyErr_SetString(socket_error,
    "can't use AF_INET6, IPv6 is disabled");
    return NULL;
    }
    #endif

    If I may be pardoned, I think it is just plain wrong. I commented it out
    to get moving.

    I couldn't get readline.c to compile because I didn't have
    readline/history.h.
    I couldn't get the bz2-module to compile, but never mind.

    What I couldn't build was a static version of Python-2.3.1 which I, for
    obscure reasons, need. Something has happened between Python-2.2.3 and
    Python 2.3.1, probably in the import area, but I know not what.

    That was my bundle of fun with SCO, but perhaps the experience will be
    helpful for others.

    Richard Sharp
    Richard Sharp, Oct 6, 2003
    #4
  5. And because it's late again in Germany:

    I meant CFLAGS and not CFLAG

    I do apologise,

    Richard

    On Mon, 06 Oct 2003 23:18:33 +0200, Richard Sharp wrote:

    > For anyone interested here is the solution to the problem. ./configure is
    > not setting HAVE_DYNAMIC_LOADING. This is because libdl.a is not being
    > found.
    > To keep it short, unless you specify CLFLAG="-b elf", SCO will only search
    > for libdl.a and not for libdl.so. libdl.a is not there and then
    > HAVE_DYNAMIC_LOADING will not be set. This will lead to a problem in
    > setup.py, which subclasses build_extension and, after building the
    > library, tries to import it, with imp.load_dynamic(..). If you look at
    > Python/import.c, then it is obvious that without HAVE_DYNAMIC_LOADING
    > there will be no method load_dynamic and thence the error message.
    >
    > So to start - CLFLAG="-b elf";export CLFLAG or the appropriate for your
    > shell.
    >
    > The other problems you may get are with socketmodule.c.
    >
    > 1. On my SCO IPv6 is not there. This means ./configure --enable-ipv6=no.
    >
    > 2. SCO does not supply h_errno and this has to be defined.
    > 3. INET_ADDRSTRLEN is not defined but required.
    >
    >
    > at line 230, the following appears
    > # ifndef RISCOS
    > # include <fcntl.h>
    > # else
    > # include <sys/ioctl.h>
    > # include <socklib.h>
    > # define NO_DUP
    > int h_errno; /* not used */
    > # define INET_ADDRSTRLEN 16
    > # endif
    >
    > I just borrowed the two lines below NO_DUP and put them right above the
    > first ifndef. It would of course be better to make the definitions
    > dependant on SCO.
    >
    > At line 2971 we have this:
    >
    > #ifndef ENABLE_IPV6
    > if(af == AF_INET6) {
    > PyErr_SetString(socket_error,
    > "can't use AF_INET6, IPv6 is disabled");
    > return NULL;
    > }
    > #endif
    >
    > If I may be pardoned, I think it is just plain wrong. I commented it out
    > to get moving.
    >
    > I couldn't get readline.c to compile because I didn't have
    > readline/history.h.
    > I couldn't get the bz2-module to compile, but never mind.
    >
    > What I couldn't build was a static version of Python-2.3.1 which I, for
    > obscure reasons, need. Something has happened between Python-2.2.3 and
    > Python 2.3.1, probably in the import area, but I know not what.
    >
    > That was my bundle of fun with SCO, but perhaps the experience will be
    > helpful for others.
    >
    > Richard Sharp
    Richard Sharp, Oct 6, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xavier
    Replies:
    0
    Views:
    405
    Xavier
    Aug 6, 2003
  2. Skip Montanaro
    Replies:
    1
    Views:
    418
    Thomas Heller
    Aug 7, 2003
  3. snacktime
    Replies:
    13
    Views:
    552
    Dan Sommers
    Feb 22, 2005
  4. Uwe Mayer

    changing from python2.3 to python2.4

    Uwe Mayer, Apr 8, 2005, in forum: Python
    Replies:
    1
    Views:
    290
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 9, 2005
  5. Ksenia Marasanova
    Replies:
    2
    Views:
    344
    Mike Meyer
    Nov 17, 2005
Loading...

Share This Page