NAPYR - Not A Python Runtime

NAPYR is an acronym for "Not a Python runtime". Well, it isn't, but it comes close.

So, what is it?

If you are a end-user: it is a setup of common python DLLs to a special folder on your system, which defaults to %Program Files%\NAPYR. You need to have NAPYR installed to use a NAPYR-enabled application.

If you are a developer: it is a setup of common python DLLs, so you don't need to package them in your installer.

What does it include?

It includes the python runtime DLL, the win32all runtime DLLs and wxPython runtime DLLs. It comes with a nice installer, and an uninstaller, courtesy of the fine NSIS.


NAPYR currently runs only on Windows NT/Windows 2000/Windows XP. It does NOT run on Windows 95/Windows 98/Windows ME.

Download and Installation

You can download the single-file installer here. You can also download the source separately, here.


This setup contains parts covered by different licenses. Man, do I hate that lawyer stuff! Anyway, here we go:

Usage for end-users

Nothing, really. All you have to do is install NAPYR, if you want to use a NAPYR-enabled application.

Usage for developers

NAPYR uses a patched version of py2exe to do its magic. Its not very impressing magic, granted, but it works. The McMillan Installer is currently not supported. OK, how does it work?

The py2exe-patch

The patch is simple, really. If the .pyd cannot be found in the local directory, the environment variable NAPYR_PATH is looked up. It must point to a directory where the .pyd can be found. I told you it was simple, didn't I? But you want the details, so here we go: the original code has this line:

    # Should catch IOError and convert into ImportError ??
    fp = open(pathname, desc[1])

which will be replaced by this block:

fp = None
    fp = open(pathname, desc[1])
except IOError:
    import nt
    pathname = "%s\\%s" % (nt.environ["NAPYR_PATH"], oldpathname)
    fp = open(pathname, desc[1])
dict['__file__'] = pathname
return 0, imp.load_module(fqname, fp, pathname, desc), dict

Why Windows NT/2K/XP only?

Because I don't want to modify the path on Windows 9x - that involves patching the autoexec.bat, which I don't have enough willpower to do.