ó ā\e[c@@såddlmZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZddlmZddlmZmZmZdd lmZmZdd lmZdd lmZdd lmZmZdd lm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(m)Z)m*Z*ddl+m,Z,ddl-m.Z.yddl/Z/Wne0k r©e1Z/nXej2e3ƒZ4defd„ƒYZ5d„Z6d„Z7dS(i(tabsolute_importN(t SUPPRESS_HELP(t pkg_resources(t cmdoptions(tRequirementCommand(t WheelCache(t CommandErrortInstallationErrortPreviousBuildDirError(tdistutils_schemetvirtualenv_no_global(tcheck_install_conflicts(tRequirementPreparer(tRequirementSettinstall_given_reqs(tRequirementTracker(tResolver(tERROR(tcheck_path_owner(t ensure_dirtget_installed_versiont(protect_pip_from_modification_on_windows(t TempDirectory(t WheelBuildertInstallCommandcB@sDeZdZdZdZdZd„Zd„Zd„Zd„Z RS(sI Install packages from: - PyPI (and other indexes) using requirement specifiers. - VCS project urls. - Local project directories. - Local or remote source archives. pip also supports installing from "requirements files", which provide an easy way to specify a whole environment to be installed. tinstalls% %prog [options] [package-index-options] ... %prog [options] -r [package-index-options] ... %prog [options] [-e] ... %prog [options] [-e] ... %prog [options] ...sInstall packages.c O@sstt|ƒj||Ž|j}|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtj ƒƒ|jtj ƒƒ|jdddddddddd ƒ|jd dd d d ddƒ|jddd d ddt ƒ|jdddddddddƒ|jdddddddddƒ|jtj ƒƒ|jtjƒƒ|jddddd d ddƒ|jddddddddgdd ƒ|jd!dd"d d dd#ƒ|jd$d%dd&d d dd'ƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jd(d d dd)dtdd*ƒ|jd+d ddd)dd,ƒ|jd-d ddd.dtdd/ƒ|jd0d ddd1dtdd2ƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒ|jtjƒƒtjtj|jƒ}|jjd3|ƒ|jjd3|ƒdS(4Ns-ts--targettdestt target_dirtmetavartdirtdefaultthelps„Install packages into . By default this will not replace existing files/folders in . Use --upgrade to replace existing packages in with new versions.s--usert use_user_sitetactiont store_truesøInstall to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.)s --no-usert store_falses--roott root_paths=Install everything relative to this alternate root directory.s--prefixt prefix_pathsIInstallation prefix where lib, bin and other top-level folders are placeds-Us --upgradetupgrades‚Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.s--upgrade-strategytupgrade_strategysonly-if-neededtchoicesteagersGDetermines how dependency upgrading should be handled [default: %default]. "eager" - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). "only-if-needed" - are upgraded only when they do not satisfy the requirements of the upgraded package(s).s--force-reinstalltforce_reinstalls;Reinstall all packages even if they are already up-to-date.s-Is--ignore-installedtignore_installeds5Ignore the installed packages (reinstalling instead).s --compiletcompiles'Compile Python source files to bytecodes --no-compiles.Do not compile Python source files to bytecodes--no-warn-script-locationtwarn_script_locations0Do not warn when installing scripts outside PATHs--no-warn-conflictstwarn_about_conflictss%Do not warn about broken dependenciesi(tsuperRt__init__tcmd_optst add_optionRt requirementst constraintstno_depstpreteditabletNoneRt build_dirtsrctignore_requires_pythontno_build_isolationtinstall_optionstglobal_optionstTruet no_binaryt only_binaryt prefer_binarytno_cleantrequire_hashest progress_bartmake_option_groupt index_grouptparsertinsert_option_group(tselftargstkwR1t index_opts((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyR0AsĄ       c#C@sĮtj|ƒd}|jr(|j}n|jrLtjj|jƒ|_ntjj|jƒ|_|j ppg}|j rÉ|j r”t dƒ‚nt ƒr¬tdƒ‚n|jdƒ|jdƒntddƒ}|jr]t|_tjj|jƒ|_tjj|jƒr<tjj|jƒ r<t dƒ‚n|jƒ|jd |jƒn|jpig}|j|ƒ}|j||ƒ}|jpŸ|j } t|j|jƒ} |jršt|jƒ rštj d |jƒd|_nt"ƒ—} t|jd | dd ƒs} t#d |j$ƒ} z6yČ|j%| |||||j&| ƒt'd| jd|jddddd|j(d|j)d| ƒ}t*d|d|d|d| d|j d|d|j+d|j,d|j-d|jd|j.ƒ }|j/| ƒt0d | j1d!ƒƒt2re|jret3||| d"gd#gƒ}|j4| j5j6ƒd|d$tƒn|j7| ƒ}|j, o„|j8}|r|j9|ƒn|j:}|jrøt;}nt<|||d%|j=d&|jd'|j d(|j>d)|d|j ƒ}t?d*|j d&|jd%|j=d'|j d|j.ƒ}t@jA|ƒ}tB|d+tCjDd,ƒƒ}g}xh|D]`}|j&}y0tE|j&d-|ƒ}|rØ|d.|7}nWntFk r¼nX|j|ƒqjWd/jG|ƒ}|rötjHd0|ƒnWngtIk rD}|jJd1k}tK|||j ƒ}tjL|d2|ƒtMStNk r`t|_‚nXWd|js…| jOƒ| jPƒnXWdQXWdQXWdQX|jr½|jQ|j||jƒn| S(3Nsto-satisfy-onlysVCan not combine '--user' and '--prefix' as they imply different installation locationssZCan not perform a '--user' install. User site-packages are not visible in this virtualenv.s--users --prefix=tkindttargets=Target path exists but is not a directory, will not continue.s--home=sŻThe directory '%s' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.tdeleteRRDR9tsrc_dirt download_dirtwheel_download_dirREtbuild_isolationt req_trackertpreparertfindertsessiont wheel_cacheR R'R*tignore_dependenciesR;R+tisolatedt modifying_piptpipt build_optionsR>t autobuildingtrootthometprefixt pycompileR-tusertkeytnamet working_sett-t sSuccessfully installed %sitexc_info(RRtcheck_install_build_globalR&R'R9tostpathtabspathRQR=R R%RR RtappendRRR?R+texiststisdirtcreateR>t_build_sessiont_build_package_finderRCRt cache_dirtformat_controlRtloggertwarningR8RR RDtpopulate_requirement_setRfR RERTRR*RZR;t isolated_modetresolveRthas_requirementtwheelRtbuildR3tvaluestget_installation_orderR.t_warn_about_conflictsR-tFalseRR$R,tget_lib_location_guessesRt WorkingSettsortedtoperatort attrgetterRt ExceptiontjointinfotEnvironmentErrort verbositytcreate_env_error_messageterrorRRt cleanup_filestcleanupt_handle_target_dir(RJtoptionsRKR'R=ttarget_temp_dirR>RXRWt build_deleteRYRUt directorytrequirement_setRVtresolvertwbt to_installtshould_warn_about_conflictsR-t installedt lib_locationsRgtreqstitemstreqtitemtinstalled_versionRŽtshow_tracebacktmessage((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pytrunĶs                                                          c @s÷t|ƒg}|Ūtdd|jƒ}|d}|d}|d}tjj|ƒrl|j|ƒntjj|ƒrš||krš|j|ƒntjj|ƒr¼|j|ƒnx.|D]&} xtj| ƒD] } | |kr)tjj|| ƒ‰t‡fd†|d Dƒƒr)qŁq)ntjj|| ƒ} tjj| ƒrĘ|slt j d| ƒqŁntjj | ƒr”t j d | ƒqŁntjj | ƒr¶t j| ƒqĘtj| ƒnt jtjj| | ƒ| ƒqŁWqĆWWdQXdS( NtRatpurelibtplatlibtdatac3@s|]}|jˆƒVqdS(N(t startswith(t.0ts(tddir(s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pys ©si’’’’sKTarget directory %s already exists. Specify --upgrade to force replacement.s„Target directory %s already exists and is a link. Pip will not automatically replace links, please remove if replacement is desired.(RR RmRlRpRotlistdirR‰tanyRwRxtislinkRqtshutiltrmtreetremovetmove( RJRR“R&t lib_dir_listtschemet purelib_dirt platlib_dirtdata_dirtlib_dirR ttarget_item_dir((R¬s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyR‘sJ        c C@sÉt|ƒ\}}|\}}xK|D]C}||d}x,||D] }tjd|||dƒqDWq%WxV|D]N}||d}x7||D]+\} } } tjd||| | | ƒq’WqsWdS(Nis*%s %s requires %s, which is not installed.isF%s %s has requirement %s, but you'll have %s %s which is incompatible.(R Rwtcritical( RJR™t package_sett _dep_infotmissingt conflictingt project_nametversiont dependencytdep_namet dep_versionRŸ((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyRĒs   ( t__name__t __module__t__doc__RftusagetsummaryR0R¤R‘R(((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyR*s  Œ Ā 8cO@s$td||Ž}|d|dgS(NR„R¦R§(R (RKtkwargsRµ((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyRƒŽscC@sŠg}|jdƒ|s<|jdƒ|jt|ƒƒn |jdƒ|dcd7<|jtjkr¹d}d}|sœ|j|d|jƒgƒn |j|ƒ|jd ƒnd j|ƒjƒdS( s{Format an error message for an EnvironmentError It may occur anytime during the execution of the install command. s5Could not install packages due to an EnvironmentErrors: t.i’’’’s s"Consider using the `--user` optionsCheck the permissionss or s. R„(RotstrterrnotEACCEStextendtlowerR‰tstrip(RŽR¢tusing_user_sitetpartstuser_option_parttpermissions_part((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyRćs"    (8t __future__RRĶtloggingR†RlR°toptparseRt pip._vendorRt pip._internalRtpip._internal.basecommandRtpip._internal.cacheRtpip._internal.exceptionsRRRtpip._internal.locationsR R tpip._internal.operations.checkR t pip._internal.operations.prepareR tpip._internal.reqR Rtpip._internal.req.req_trackerRtpip._internal.resolveRtpip._internal.status_codesRtpip._internal.utils.filesystemRtpip._internal.utils.miscRRRtpip._internal.utils.temp_dirRtpip._internal.wheelRR}t ImportErrorR8t getLoggerRÅRwRRƒR(((s=/tmp/pip-install-0xiv62/pip/pip/_internal/commands/install.pyts>       ’µ