From e1fdf55bd8592f33a563a740f64750ab1c9d5757 Mon Sep 17 00:00:00 2001 From: Abolfazl Date: Thu, 25 Feb 2021 03:36:47 +0330 Subject: [PATCH] small bugfix fixed "FileNotFoundError: [Errno 2] No such file or directory: 'python' " on ubuntu 20.04 --- djangocms_installer/install/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/djangocms_installer/install/__init__.py b/djangocms_installer/install/__init__.py index 81826bcd..b65db10f 100644 --- a/djangocms_installer/install/__init__.py +++ b/djangocms_installer/install/__init__.py @@ -91,7 +91,10 @@ def requirements(req_file, pip_options="", is_file=False, verbose=False): sys.stdout.write("python path: {}\n".format(sys.executable)) sys.stdout.write("packages install command: {}\n".format(" ".join(cmd))) try: - subprocess.check_output(["python", "-msite"], stderr=subprocess.STDOUT) + try: + subprocess.check_output(["python", "-msite"], stderr=subprocess.STDOUT) + except FileNotFoundError: + subprocess.check_output(["python3", "-msite"], stderr=subprocess.STDOUT) output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) sys.stdout.write(output.decode("utf-8")) except Exception as e: # pragma: no cover