From dea0fcc84576cec389f93d666c2d8b3ceeb6812c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 11 Jul 2015 00:02:42 -0700 Subject: [PATCH] Improve virtual env detection --- homeassistant/util/environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/util/environment.py b/homeassistant/util/environment.py index f2e41dfb306..4227c485290 100644 --- a/homeassistant/util/environment.py +++ b/homeassistant/util/environment.py @@ -4,4 +4,5 @@ import sys def is_virtual(): """ Return if we run in a virtual environtment. """ - return sys.base_prefix != sys.prefix + # Check supports venv && virtualenv + return sys.base_prefix != sys.prefix or hasattr(sys, 'real_prefix')