From cd711b04dc995cbe1a4d97df3a32c01f2630a3aa Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Thu, 28 Nov 2019 10:11:03 +0530 Subject: [PATCH] fix: bench update compatible venv installed pkg --- bench/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bench/utils.py b/bench/utils.py index 852200f0..1536cb9c 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -503,6 +503,10 @@ def update_npm_packages(bench_path='.'): def install_requirements(pip, req_file, user=False): if os.path.exists(req_file): + # sys.real_prefix exists only in a virtualenv + if hasattr(sys, 'real_prefix'): + user = False + user_flag = "--user" if user else "" exec_cmd("{pip} install {user_flag} -q -U -r {req_file}".format(pip=pip, user_flag=user_flag, req_file=req_file))