[newbie] import fails first time, then works :-[

laotseu bdesth at nospam.free.fr
Fri Jun 21 21:09:05 CEST 2002


Hi Everybody

I've got this strange problem :
when importing modules that wrap external modules (like socket and 
_socket etc), the first time, I get an ImportError
(no module named _[module]).
If i try a second time, it works ok ?-o

Exemple :
 >>> import socket
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.2/socket.py", line 41, in ?
     from _socket import *
ImportError: No module named _socket
 >>> import socket
 >>> socket
<module 'socket' from '/usr/local/lib/python2.2/socket.pyc'>
 >>>

A little precision :
the external modules are at the right place (PYTHONPATH/dyn-load)

Help !

laotseu

PS : python 2.2 on a linux-box




More information about the Python-list mailing list