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):
print(command, len(command))
#print(command, len(command))
if len(command) != 1:
print("comand requires [ package_name ] [ args (optional) ] ")
return
package = command[0]
try:
from pip._internal import main as pipmain
pipmain(['install', {package}])
except ImportError:
os.system(f"pip install {package}")
print("Running pip from shell")
os.system(f"python -m pip install {package}")
except Exception as e:
print(e)
except:
print("cannot download")