_socket on solaris

Fredrik Lundh fredrik at pythonware.com
Wed May 1 05:04:55 EDT 2002


eli li wrote:

> When I run my program on Solaris, the next message is printed.
>
>    Traceback (most recent call last):
>     . . . . . . . . . . . . . . . . . . . . .
>      File "/usr/local/lib/python2.2/socket.py", line 41, in ?
>        from _socket import *
>    ImportError: No module named _socket
>
> The reason is clear: file _socket is not found. Where can I found this
> library?

the _socket module is part of the standard distribution.  if you
don't have it, your install/configuration is broken.

some possible reasons:

- you're picking up a pre-2.2 interpreter, but have set the
PYTHONHOME or PYTHONPATH environment variables to point
to a newer standard library.  to check this, just run "python"
without any arguments, and look for the version number on
the first line.

- whoever installed python messed up, and failed to copy the
extension modules.  to check this, start the interpreter and type:

    >>> import sys
    >>> sys.path

look for a lib-dynload directory in the path, and check that there's
a file called _socket.so (or _socketmodule.so) in that directory.

- if this doesn't help, rebuild/double-check/reinstall (or ask your
local friendly system administrator for help).

</F>





More information about the Python-list mailing list