Python native compiler on NT

Fredrik Lundh fredrik at pythonware.com
Fri Jan 14 05:19:09 EST 2000


tpchang at my-deja.com wrote:
> Thanks for the info. I tried the "Installer". However, to run
> the "compiled" .exe file, say xyz.exe, you have to copy xyz.exe and
> zlib.pyd to current directory before you can run it. Some how putting
> xyz.exe and zlib.pyd in a directory in the PATH, and run xyz.exe from
> another directory will have a error message something like:
> 
>    cannot load zlib.pyd
> 
> Do you know what's the problem?

Python scans the PYTHONPATH when looking
for PYD files, not the standard program path
(PYD's are extension modules, not executables).

try printing the contents of sys.path inside
your "compiled" script.  in worst case, you
can always add tweak sys.path yourself; e.g:

    import sys
    sys.path.insert(0, os.path.dirname(sys.executable))

or something like that.

</F>





More information about the Python-list mailing list