def get_site_packages_dir() -> str:
    """Returns a string with the python platform lib path (to site-packages)."""
    # This assumes we are running in the primary st2 virtualenv (typically /opt/stackstorm/st2)
    site_packages_dir = get_path("platlib")

    sys_prefix = os.path.abspath(sys.prefix)
    if sys_prefix not in site_packages_dir:
        raise ValueError(
            f'The file with "{sys_prefix}" is not found in "{site_packages_dir}".'
        )

    return site_packages_dir
Returns a string with the python platform lib path (to site-packages).
st2common/st2common/util/sandboxing.py