stlib name clash when using python as ASP language

Gabriel Genellina gagsl-py at yahoo.com.ar
Fri Feb 2 10:51:53 EST 2007


"Joost" <JoostMoesker at gmail.com> escribió en el mensaje 
news:1170323389.184681.250640 at v45g2000cwv.googlegroups.com...

> When using ASP the iis/inetsrv path is placed as the first item in
> sys.path. Consequently importing httplib2 will cause the following
> error:
>
> ImportError: dynamic module does not define init function (initgzip)
>
> The following per page hack *fixes* the problem most of the time:
> import sys
> sys.path[0] = "c:/python24/lib"
>
> Strangely, even with this code loaded in every page the import error
> sporadically occurs. What would be the preferred way to solve this
> name clash?

You *assume* that [0] is the IIS path, but perhaps some other imported 
module changed sys.path too, and now it's not the first one anymore.
If you know exactly the path, try sys.path.remove(iis_path).

-- 
Gabriel Genellina 





More information about the Python-list mailing list