当前位置: 首页>>代码示例>>Python>>正文


Python pip.py方法代码示例

本文整理汇总了Python中pip.py方法的典型用法代码示例。如果您正苦于以下问题:Python pip.py方法的具体用法?Python pip.py怎么用?Python pip.py使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip的用法示例。


在下文中一共展示了pip.py方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup

# 需要导入模块: import pip [as 别名]
# 或者: from pip import py [as 别名]
def setup(self, data):
        if not data:
            # It's safe to use ensurepip.
            print("Installing pip...")
            try:
                import ensurepip
                ensurepip.bootstrap()
            except PermissionError:
                # panic and try and sudo it
                sudo_check_call("python3.5 -m ensurepip")
            return

        # Instead, we have to run get-pip.py.
        print("Installing pip...")
        try:
            sudo_check_call(["python3.5", "{}".format(data)])
        except FileNotFoundError:
            subprocess.check_call(["python3.5", "{}".format(data)]) 
开发者ID:helionmusic,项目名称:rhinobot_heroku,代码行数:20,代码来源:bootstrap.py

示例2: apply_vagrant_workaround

# 需要导入模块: import pip [as 别名]
# 或者: from pip import py [as 别名]
def apply_vagrant_workaround():
    """
    Function which detects if the script is being executed inside vagrant and if it is, it deletes
    "os.link" attribute.
    Note: Without this workaround, setup.py sdist will fail when running inside a shared directory
    (nfs / virtualbox shared folders).
    """
    if os.environ.get('USER', None) == 'vagrant':
        del os.link 
开发者ID:StackStorm,项目名称:st2-auth-backend-ldap,代码行数:11,代码来源:dist_utils.py

示例3: pip_main

# 需要导入模块: import pip [as 别名]
# 或者: from pip import py [as 别名]
def pip_main(argv):
    # Extract the certificates from the PAR following the example of get-pip.py
    # https://github.com/pypa/get-pip/blob/430ba37776ae2ad89/template.py#L164-L168
    cert_tmpdir = tempfile.mkdtemp()
    cert_path = os.path.join(cert_tmpdir, "cacert.pem")
    atexit.register(lambda: shutil.rmtree(cert_tmpdir, ignore_errors=True))
    with open(cert_path, "wb") as cert:
      cert.write(pkgutil.get_data("pip._vendor.requests", "cacert.pem"))
    argv = ["--isolated", "--disable-pip-version-check", "--cert", cert_path] + argv
    return pip.main(argv) 
开发者ID:bazelbuild,项目名称:rules_python,代码行数:12,代码来源:piptool.py

示例4: download

# 需要导入模块: import pip [as 别名]
# 或者: from pip import py [as 别名]
def download(self):
        # Try and use ensurepip.
        try:
            import ensurepip
            return False
        except ImportError:
            # Download `get-pip.py`.
            # We hope we have urllib.request, otherwise we're sort of fucked.
            f = tempfile.NamedTemporaryFile(delete=False)
            f.close()  # we only want the name
            print("Downloading pip...")
            urlretrieve(GET_PIP, f.name)
            return f.name 
开发者ID:helionmusic,项目名称:rhinobot_heroku,代码行数:15,代码来源:bootstrap.py


注:本文中的pip.py方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。