Fixed pip package
This commit is contained in:
parent
101bf6ed1c
commit
0837f6c5fd
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user