Config.init_libpath only looks at sysconfig.get_python_lib() (usually /usr/lib/), and doesnt include sysconfig.get_python_lib(plat_specific=True) , which is usually /usr/lib64. The later is where re.match will come from for most distro users. Both directories need to be used to determine if a module is part of the stdlib.