def get_site_packages_path(path=None):
    """Return the path to the Python site-packages directory."""
    python_path = Path(path) if path else Path(sys.executable)
    base_dir = python_path if python_path.is_dir() else python_path.parent
    site_packages = base_dir / 'Lib' / 'site-packages'
    pypy_site_packages = base_dir / 'site-packages'  # For PyPy
    return str(pypy_site_packages if pypy_site_packages.is_dir() else site_packages)
Return the path to the Python site-packages directory.
winpython/utils.py