From 910f281b0cbf3b2819bb757cbfc2a728a6e04732 Mon Sep 17 00:00:00 2001 From: dmc Date: Tue, 26 Nov 2024 14:57:23 +0100 Subject: [PATCH] add nicosenv to PATH before starting asssure that PATH and therefore python venv ist the same when starting frappy from NICOS and from commandline --- base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base.py b/base.py index 7717f54..8144dee 100644 --- a/base.py +++ b/base.py @@ -24,7 +24,7 @@ import sys import json import os -from os.path import expanduser, basename +from os.path import expanduser, basename, exists import subprocess import time import re @@ -357,6 +357,9 @@ class ServiceManager: os.chdir(start_dir) if start_dir not in sys.path: sys.path.insert(0, start_dir) + nicosenv = '/home/nicos/nicos/nicosenv/bin/' + if exists(nicosenv): + env['PATH'] = f"{nicosenv}:{env['PATH']}" if wait: proc = subprocess.Popen(cmd.split(), env=env) for _ in range(3):