Problems importing _sre w/VC7-compiled Python 2.1

John Machin sjmachin at lexicon.net
Sat May 18 20:17:12 EDT 2002


"RoadRunner eNews" <audballio at yahoo.com> wrote in message news:<urxF8.92424$9F5.5507182 at typhoon.austin.rr.com>...
> I've successfully built Python 2.1 with VC7, but I'm having a problem using
> the resulting binaries, namely _sre.pyd (and _d.pyd).  Specifically, when I
> attempt to 'import re', the result is a Traceback stating 'ImportError:
> dynamic module does not define init function (init_sre)'.   Everything works
> fine under VC6, and ...\modules\_sre.c definitely contains init_sre(), so it
> has to be something VC7 related.
> 

I'm not an MS VCn guru for any value of n. However, based on some
trips through "DLL hell" with other compilers, here are some ideas
that may help:

(1) Use the Dependency Walker or some other tool to examine the
_sre.pyd itself to see that the entry point init_sre is actually there
(and not _init_sre or something else), rather than relying on its
presence in the source. Then you will know whether the problem is in
the importer or the importee.

(2) If you haven't done so already, you should use the -v option when
running Python, to display the names of the actual full paths for
files that it is opening. However I can't recall whether you will get
the path printed before the ImportError.

HTH,
John



More information about the Python-list mailing list