From 35cb757df80dbd59d781a4cf594aa8fcb8fd66b5 Mon Sep 17 00:00:00 2001 From: Matheus Horstmann Date: Thu, 9 Sep 2021 23:51:16 -0300 Subject: [PATCH] Resolved problem in virtualenv detection Fix #1535 --- bazarr/init.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bazarr/init.py b/bazarr/init.py index 928c44f3d..6560ad911 100644 --- a/bazarr/init.py +++ b/bazarr/init.py @@ -45,8 +45,10 @@ import logging def is_virtualenv(): # return True if Bazarr have been start from within a virtualenv or venv - base_prefix = getattr(sys, "base_prefix", None) or getattr(sys, "real_prefix", None) or sys.prefix - return base_prefix != sys.prefix + base_prefix = getattr(sys, "base_prefix", None) + # real_prefix will return None if not in a virtualenv enviroment or the default python path + real_prefix = getattr(sys, "real_prefix", None) or sys.prefix + return base_prefix != real_prefix # deploy requirements.txt