def _get_session_python_site_packages_dir(session):
    try:
        site_packages_dir = session._runner._site_packages_dir
    except AttributeError:
        old_install_only_value = session._runner.global_config.install_only
        try:
            session._runner.global_config.install_only = False
            site_packages_dir = session.run('python', '-c', 'import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib())', silent=True, log=False)
            session._runner._site_packages_dir = site_packages_dir
        finally:
            session._runner.global_config.install_only = old_install_only_value
    return site_packages_dir
def _get_session_python_site_packages_dir(session):
    try:
        site_packages_dir = session._runner._site_packages_dir
    except AttributeError:
        old_install_only_value = session._runner.global_config.install_only
        try:
            session._runner.global_config.install_only = False
            site_packages_dir = session.run('python', '-c', 'import sys; from distutils.sysconfig import get_python_lib; sys.stdout.write(get_python_lib())', silent=True, log=False)
            session._runner._site_packages_dir = site_packages_dir
        finally:
            session._runner.global_config.install_only = old_install_only_value
    return site_packages_dir