_socket missing??

Peter Ballard pballard at ozemail.com.au
Thu Mar 6 12:45:50 EST 2003


G'day all,

Apologies if this is really basic stuff...

I run python inside cygwin on my windows98 box. (I have recently
upgraded from python 2.1 to 2.2, but I don't know if that is the
problem because I haven't tried to use socket.py until now). I traced
my problem down to the python library socket. Here is a session:

$ python
Python 2.2.2 (#1, Dec 31 2002, 12:24:34)
[GCC 3.2 20020927 (prerelease)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.2/socket.py", line 41, in ?
    from _socket import *
ImportError: dlopen: Win32 error 1157

I found out that _socket is meant to be built-in so I did this:

>>> import sys
>>> print sys.builtin_module_names
('__builtin__', '__main__', '_sre', '_symtable', 'errno',
'exceptions',
'gc', 'imp', 'marshal', 'new', 'posix', 'signal', 'sys', 'thread', 
'xxsubtype')
>>>

(Apparently '_socket' should appear above).

So what's going on? Is my installation totally mangled, or is there
some easy fix? I have no _socket.py, but I do have a _socket.dll
(/usr/lib/python2.2/lib-dynload/_socket.dll)


Thanks in advance,

Peter Ballard
Adelaide, AUSTRALIA
pballard at ozemail.com.au
http://www.ozemail.com.au/~pballard/




More information about the Python-list mailing list