(prefix, packages, upgrade=False)
Ensure pip packages are installed in the given conda prefix.
Ensure pip packages are installed in the given conda prefix.
Ensure pip packages are installed in the given conda prefix .
def ensure_pip_packages(prefix, packages, upgrade=False):
    """
    Ensure pip packages are installed in the given conda prefix.
    """
    abspath = os.path.abspath(prefix)
    pip_executable = [os.path.join(abspath, "bin", "python"), "-m", "pip"]
    pip_cmd = pip_executable + ["install"]
    if upgrade:
        pip_cmd.append("--upgrade")
    utils.run_subprocess(pip_cmd + packages)
    fix_permissions(prefix)
def ensure_pip_packages ( prefix , packages , upgrade = False ) : abspath = os . path . abspath ( prefix ) pip_executable = [ os . path . join ( abspath , "bin" , "python" ) , "-m" , "pip" ] pip_cmd = pip_executable + [ "install" ] if upgrade : pip_cmd . append ( "--upgrade" ) utils . run_subprocess ( pip_cmd + packages ) fix_permissions ( prefix )