Fixed pip package

This commit is contained in:
OusmBlueNinja 2023-08-26 21:41:15 -05:00
parent 101bf6ed1c
commit 0837f6c5fd

View File

@ -5,17 +5,18 @@ import os, sys
def pip(command: list): def pip(command: list):
print(command, len(command)) #print(command, len(command))
if len(command) != 1: if len(command) != 1:
print("comand requires [ package_name ] [ args (optional) ] ") print("comand requires [ package_name ] [ args (optional) ] ")
return return
package = command[0] package = command[0]
try: try:
from pip._internal import main as pipmain print("Running pip from shell")
pipmain(['install', {package}]) os.system(f"python -m pip install {package}")
except ImportError: except Exception as e:
os.system(f"pip install {package}") print(e)
except: except:
print("cannot download") print("cannot download")