look further down sys.path for extension module
"Martin v. Löwis"
martin at v.loewis.de
Wed Oct 27 20:48:05 CEST 2004
Vincent Wehren wrote:
> Is it possible to have Python look further down sys.path for a C
> extension module when an ImportError is raised because of the "dynamic
> module not implementing init function"?
You could use the imp module to import zlib.pyd "manually". Then, when
an "import zlib" occurs, it looks into sys.modules, finds that zlib is
already there, and forgets about looking into sys.path.
Alternatively, you could rebuild zlib.pyd to be named pyzlib.pyd. You
need to rebuild the code because you also need to rename the entry
function, and the name of the module inside the module itself. You
can then do
import pyzlib as zlib
More information about the Python-list