ImportError: No module named _socket

Thomas Wouters thomas at xs4all.net
Tue Jul 17 10:34:14 EDT 2001


On Tue, Jul 17, 2001 at 11:55:33AM +0000, Iain Hallam wrote:

> I've only just started using Python and attempted the default install on 
> a Solaris 2.6 box here at university. Everything seemed to work OK 
> (considering I was only testing it by running "Hello World!" type 
> programs) and the sysadmin kindly installed it system wide.

> I've just downloaded the ping modules by Jeremy Hylton, and they import 
> the socket module. All well and good - it's in 
> /usr/local/lib/python2.1/socket.py - but the line that imports _socket 
> fails. Could someone tell me where I can find this module in our 
> install, please?

It should be in /usr/local/lib/python2.1/lib-dynaload/, as
'_socketmodule.so'. Chances are it really is there (I assume you're running
either 2.1 or 2.1.1) but that the permissions are wrong. This can happen if
you have a restrictive umask while installing Python (which is a good idea,
granted.) You can fix it by making the files readable for everyone ('chmod
a+r *'). The directory should have the right permission already (0755, or
'drwxr-xr-x') I think, but it doesn't hurt to check, of course.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list