From c0a57c7814bd531250a2ec5fb0cf812390f16f3c Mon Sep 17 00:00:00 2001 From: Serial_Jaywalker Date: Mon, 16 Dec 2024 01:52:03 -0800 Subject: [PATCH] Check if in venv before attempting user install/update. --- fastanime/cli/app_updater.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fastanime/cli/app_updater.py b/fastanime/cli/app_updater.py index 7bf1ef4..e9962f8 100644 --- a/fastanime/cli/app_updater.py +++ b/fastanime/cli/app_updater.py @@ -128,9 +128,13 @@ def update_app(force=False): "install", APP_NAME, "-U", - "--user", "--no-warn-script-location", ] + if sys.prefix == sys.base_prefix: + # ensure NOT in a venv, where --user flag can cause an error. + # TODO: Get value of 'include-system-site-packages' in pyenv.cfg. + args.append('--user') + process = subprocess.run(args) if process.returncode == 0: return True, release_json