Problems with importing; must do it twice?

Aahz aahz at pythoncraft.com
Thu Jun 13 15:49:55 EDT 2002


In article <fgphgus0pv2c7hp8l27uaenjlerr97tdta at 4ax.com>,
Stew LG  <stew at ten_INVALID_box.com> wrote:
>	
>My web host just switched hardware, and in the process I've been moved
>to Solaris and Python 2.1.1.

Your web host failed to compile Python correctly; talk with them.

>This seemed insane to me, so I tried Python from the command line.
>Same thing, but when I import it *again* it works:

No, it didn't.  Python caches import names even when the import fails
(protects against circular references); try using the cgi module for
anything that requires a socket and it'll die.  It might work for the
other functions in the cgi module, depending on when cgi tried to import
the socket code.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I had lots of reasonable theories about children myself, until I
had some."  --Michael Rios



More information about the Python-list mailing list