Problems importing anything using _socket

Chris Liechti cliechti at gmx.net
Tue Mar 5 16:04:48 EST 2002


h.e.w.frater at cs.cf.ac.uk (Hugh) wrote in 
news:e2e9e807.0203050335.65ca52f4 at posting.google.com:
> Hi all,
>  I'm totally new to python, but have decided to use it to do a 

welcome

> first year uni project. I've got to develop a web based library. 
> I'm using oracle with the DCOracle2 module, and that works fine. 
> But I can't import anything that uses _socket. If I try and do an 
> "import cgi" frok inside the interpreter, I get this message:
>>>> import cgi
> Traceback (most recent call last):
...
>   File "/usr/local/lib/python2.2/socket.py", line 41, in ?
>     from _socket import *
> ImportError: No module named _socket
>>>> import cgi
>>>> 
> 
> However, As you can see from above If I then type and run the line
> "import cgi" again, it forks fine. Any ideas?

no it doesn't work. the module is half initialized in the module-
cache. it's only loaded gain when you type "reload(cgi)" and it will 
certainly print the error again.

"_socket" is a .so file that should be in some subdirectory of your 
python installation. Seems that your installation is broken.

you seem to be on an Un*x/Linux, i can't help you there - every thing 
worked fine on my Debina machine. maybe some other has an idea.
(i would try the configure/make/make install dance again, but i'm 
also a winblows user ;-)

chris
-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list