update install for devchat
This commit is contained in:
parent
8bc7f63c09
commit
5de9d0f7ee
32321
tools/get-pip.py
Normal file
32321
tools/get-pip.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,10 +6,18 @@ import sys
|
|||||||
pythonCommand = sys.executable
|
pythonCommand = sys.executable
|
||||||
print('Python command:', pythonCommand)
|
print('Python command:', pythonCommand)
|
||||||
|
|
||||||
|
tools_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
def ensure_pip_installed():
|
def ensure_pip_installed():
|
||||||
print("install pip ...")
|
print("install pip ...")
|
||||||
try:
|
try:
|
||||||
subprocess.run([pythonCommand, "-m", "ensurepip", "--upgrade"], check=True)
|
subprocess.run([pythonCommand, "-m", "pip", "--version"], check=True)
|
||||||
|
return True
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.run([pythonCommand, tools_dir + "/get-pip.py", "--force-reinstall"], check=True)
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
@ -25,7 +33,7 @@ def check_pipx_installed():
|
|||||||
def install_pipx():
|
def install_pipx():
|
||||||
print("Installing pipx...")
|
print("Installing pipx...")
|
||||||
try:
|
try:
|
||||||
subprocess.run([pythonCommand, "-m", "pip", "install", "pipx", "--force"], check=True)
|
subprocess.run([pythonCommand, "-m", "pip", "install", "--user", "pipx", "--force-reinstall"], check=True)
|
||||||
print("pipx installed successfully.")
|
print("pipx installed successfully.")
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
print("Error installing pipx:", e, file=sys.stderr)
|
print("Error installing pipx:", e, file=sys.stderr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user