def get_env_libpath():
    libpathvname = _lpdict.get(sys.platform)

    if libpathvname:
        print "\nScanning virtualenv for shared libraries..."
        topdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.executable)))

        libfiles = []

        if sys.platform.startswith('win'):
            pkgdir = os.path.join(topdir, 'Lib',
                                  'site-packages')
            checker = '*.dll'
        else:
            pkgdir = os.path.join(topdir, 'lib',
                                  'python%s.%s' % sys.version_info[:2],
                                  'site-packages')
            if sys.platform == 'darwin':
                checker = lambda n: n.endswith('.so') or n.endswith('.dylib')
            else:
                checker = "*.so"

        for d in os.listdir(pkgdir):
            d = os.path.join(pkgdir, d)
            if os.path.isdir(d):
                # find any shared libs that don't have a matching .py bootstrapper
                newlibs = []
                for f in find_files(d, checker):
                    if not os.path.isfile(os.path.splitext(f)[0]+'.py'):
                        newlibs.append(f)
                libfiles.extend(newlibs)

        # if the same library appears multiple times under the same subdir parent, remove
        # it from the libpath.
        # Better to fail due to missing lib than to use one with the wrong bitsize...
        # TODO: add some smarts to figure out desired bitsize and keep the correct lib
        #       in the libpath
        bases = {}
        for fname in libfiles:
            bases.setdefault(os.path.basename(fname), []).append(fname)

        if len(bases) < len(libfiles):
            for base, paths in bases.items():
                if len(paths) > 1:
                    for p in paths:
                        libfiles.remove(p)

        added = set([os.path.dirname(n) for n in libfiles])
        if added:
            print "adding the following dirs to %s" % libpathvname
        for name in added:
            print name
        return os.pathsep.join(added)
    return ''
Find all of the shared libraries in the current virtual environment and
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/lib.py/get_env_libpath