U ��.e&�@s�dZddlmZddlZddlZddlZddlZddlZddlZddl mZ ddl m Z ddl mZddlmZddlmZdd lmZer�dd lmZmZmZmZmZe�d �Zd d �Zdd�Ze�d�Z e�!��"�dkr�e �#�Z z e�$�Z%Wne&k �r ej'Z%YnXe�r`ej(�)ej*d�Z+ej(�)e%d�Z,ej(�-e+��s�ej(�)ej*d�Z+ej(�)e%d�Z,nJej(�)ej*d�Z+ej(�)e%d�Z,ejdd�dk�r�ej*dd�dk�r�dZ+ddd�Z.dS)z7Locations where we look for configs, install stuff, etc�)�absolute_importN)� sysconfig)� SCHEME_KEYS)�appdirs)�WINDOWS)�MYPY_CHECK_RUNNING)�running_under_virtualenv)�Any�Union�Dict�List�OptionalZpipcCs djtj�S)ze Return the major-minor version of the current Python as a string, e.g. "3.7" or "3.10". z{}.{})�format�sys� version_info�rr�;/usr/lib/python3.8/site-packages/pip/_internal/locations.py�get_major_minor_versionsrcCsZt�rtj�tjd�}n6ztj�t��d�}Wntk rLt�d�YnXtj� |�S)N�srcz=The folder you are executing pip from can no longer be found.) r�os�path�joinr�prefix�getcwd�OSError�exit�abspath)Z src_prefixrrr�get_src_prefix(s� r�purelibZpypyZScripts�bin��darwin�z/System/Library/z/usr/local/binFcCsHddlm}i}|r ddgi}ni}d|i} | �|�|| �} | ��| jddd�} |p\| j| _|sh|rnd | _|pv| j| _|p�| j| _|p�| j| _| � �t D]} t | d | �|| <q�d | � d�kr�|�t | j| jd ��t��rDtj�tjd dd�t��|�|d<|dk �rDtj�tj�|d��d} tj�|| dd��|d<|S)z+ Return a distutils install scheme r)� DistributionZ script_argsz --no-user-cfg�nameZinstallT)Zcreate�Zinstall_� install_lib)rZplatlibZinclude�sitezpython{}ZheadersN�)Zdistutils.distr#�updateZparse_config_filesZget_command_obj�userr�home�rootZfinalize_optionsr�getattrZget_option_dict�dictr&rrrrrrr� splitdriver)Z dist_namer*r+r,�isolatedrr#ZschemeZextra_dist_argsZ dist_args�d�i�keyZ path_no_driverrr�distutils_scheme[sP         � �� �r4)FNNFN)/�__doc__Z __future__rrZos.path�platformr'rrZ distutilsZdistutils_sysconfigZdistutils.command.installrZpip._internal.utilsrZpip._internal.utils.compatrZpip._internal.utils.typingrZpip._internal.utils.virtualenvr�typingr r r r r Zuser_cache_dirZUSER_CACHE_DIRrrZget_pathZ site_packagesZpython_implementation�lowerZget_python_lib�getusersitepackages� user_site�AttributeError� USER_SITErrrZbin_pyZbin_user�existsr4rrrr�sN            (�