Fix pip 1.5.4 compatibility

This commit is contained in:
Paulus Schoutsen 2015-07-10 21:24:28 -07:00
parent 33e983a5c3
commit 2b23eec0f7
2 changed files with 3 additions and 4 deletions

View File

@ -22,8 +22,7 @@ def validate_python():
def install_package(package):
"""Install a package on PyPi. Accepts pip compatible package strings.
Return boolean if install successfull."""
args = ['python3', '-m', 'pip', 'install', '--disable-pip-version-check',
'--quiet', package]
args = ['python3', '-m', 'pip', 'install', '--quiet', package]
if sys.base_prefix == sys.prefix:
args.append('--user')
return not subprocess.call(args)
@ -31,6 +30,7 @@ def install_package(package):
def validate_dependencies():
""" Validate all dependencies that HA uses. """
print("Validating dependencies...")
import_fail = False
for requirement in DEPENDENCIES:

View File

@ -11,8 +11,7 @@ def install_package(package, upgrade=False, user=INSTALL_USER):
"""Install a package on PyPi. Accepts pip compatible package strings.
Return boolean if install successfull."""
# Not using 'import pip; pip.main([])' because it breaks the logger
args = ['python3', '-m', 'pip', 'install', '--disable-pip-version-check',
'--quiet', package]
args = ['python3', '-m', 'pip', 'install', '--quiet', package]
if upgrade:
args.append('--upgrade')
if user: