mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Add a check to ensure pip is installed
This commit is contained in:
parent
a3906242e9
commit
e277decd4c
@ -21,6 +21,16 @@ def validate_python():
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
|
def ensure_pip():
|
||||||
|
""" Validate pip is installed so we can install packages on demand. """
|
||||||
|
if importlib.find_loader('pip') is None:
|
||||||
|
print("Your Python installation did not bundle 'pip'")
|
||||||
|
print("Home Assistant requires 'pip' to be installed.")
|
||||||
|
print("Please install pip: "
|
||||||
|
"https://pip.pypa.io/en/latest/installing.html")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
# Copy of homeassistant.util.package because we can't import yet
|
# Copy of homeassistant.util.package because we can't import yet
|
||||||
def install_package(package):
|
def install_package(package):
|
||||||
"""Install a package on PyPi. Accepts pip compatible package strings.
|
"""Install a package on PyPi. Accepts pip compatible package strings.
|
||||||
@ -36,6 +46,8 @@ def install_package(package):
|
|||||||
|
|
||||||
def validate_dependencies():
|
def validate_dependencies():
|
||||||
""" Validate all dependencies that HA uses. """
|
""" Validate all dependencies that HA uses. """
|
||||||
|
ensure_pip()
|
||||||
|
|
||||||
print("Validating dependencies...")
|
print("Validating dependencies...")
|
||||||
import_fail = False
|
import_fail = False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user