From bf1bb53c9616d76bb4a3d04c2d751b394c42eed3 Mon Sep 17 00:00:00 2001 From: ReinerRego Date: Mon, 18 Mar 2024 21:34:07 +0100 Subject: [PATCH] package name is not the same as in pip bugfix --- tools.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools.py b/tools.py index 1dfcf08..6d407a6 100644 --- a/tools.py +++ b/tools.py @@ -5,18 +5,18 @@ import sys def install(package): subprocess.check_call([sys.executable, "-m", "pip", "install", package]) -# List of required packages -required_packages = [ - "console-menu", - "bottombar" -] +# Dictionary mapping required package names to import names +package_mapping = { + "console-menu": "consolemenu", + "bottombar": "bottombar" +} # Check for missing packages missing_packages = [] -for package in required_packages: - spec = importlib.util.find_spec(package) +for required_package, import_name in package_mapping.items(): + spec = importlib.util.find_spec(import_name) if spec is None: - missing_packages.append(package) + missing_packages.append(required_package) # If missing packages are found, ask the user whether to install them if missing_packages: