No model named _socket

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arend Sluis

    No model named _socket

    Hi,

    **obligatory python newbie warning*

    I have been trying to install python 2.3.2 on Solaris 2.7 (SPARC). Both
    'configure' and 'make' do not give problems, but 'make test' does complain:

    7 tests failed:
    test___all__ test_logging test_mimetools test_socket test_sundry
    test_tempfile test_urllib2

    All but test_tempfile can be traced back to the error:

    ImportError: No module named _socket

    I have been digging through the FAQ and the bug list, but I cannot find
    anything helpful. Any help is welcome. (I can provide more details, if
    necessary.)

  • Eric Brunel

    #2
    Re: No model named _socket

    Arend Sluis wrote:[color=blue]
    > Hi,
    >
    > **obligatory python newbie warning*
    >
    > I have been trying to install python 2.3.2 on Solaris 2.7 (SPARC). Both
    > 'configure' and 'make' do not give problems, but 'make test' does complain:
    >
    > 7 tests failed:
    > test___all__ test_logging test_mimetools test_socket test_sundry
    > test_tempfile test_urllib2
    >
    > All but test_tempfile can be traced back to the error:
    >
    > ImportError: No module named _socket
    >
    > I have been digging through the FAQ and the bug list, but I cannot find
    > anything helpful. Any help is welcome. (I can provide more details, if
    > necessary.)[/color]

    I just got (and solved) the same problem. What you should do is the following:
    - Go to your Modules directory and edit the file Setup
    - In this file, search for _socket and uncomment the line for the module (the
    one looking like "_socket socketmodule.c" )
    - Retry running "make"; if it works, you're done. If it doesn't (and it probably
    won't...;-), read on.
    - If the compile errors you got on socketmodule.c concerned macros AF_INET6 and
    INET_ADDRSTRLEN , make the following changes in the file (in this order):
    .. at line 317, add the following lines:
    #if defined(__sun) && ! defined(INET_AD DRSTRLEN)
    #define INET_ADDRSTRLEN 16
    #endif
    .. the line 2975 should be a "#ifdef ENABLE_IPV6"; change it to:
    #if defined(ENABLE_ IPV6) && defined(AF_INET 6)

    If our problems were the same, this should make things work. You may have to
    reconfigure your Python installation using the flag --disable-ipv6.

    For Python-guys: the modifications above are indeed a quick and dirty hack, but
    actually make the "socket" module work on Solaris 7. Maybe they should be
    included in the next release.
    --
    - Eric Brunel <eric dot brunel at pragmadev dot com> -
    PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com

    Comment

    • Arend Sluis

      #3
      Re: No model named _socket

      Your suggestions worked (I did not need to fiddle with the configuration
      and --disable-ipv6 flag). Just for completeness, the line 2975 of
      socketmodule.c (after addition at line 317) actually reads
      #ifndef ENABLE_IPV6

      Thanks for your help!

      Comment

      Working...