update install for devchat

This commit is contained in:
bobo.yang 2023-07-06 07:42:44 +08:00
parent 8bc7f63c09
commit 5de9d0f7ee
2 changed files with 32331 additions and 2 deletions

32321
tools/get-pip.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6,10 +6,18 @@ import sys
pythonCommand = sys.executable
print('Python command:', pythonCommand)
tools_dir = os.path.dirname(os.path.realpath(__file__))
def ensure_pip_installed():
print("install pip ...")
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
except Exception as e:
print(e)
@ -25,7 +33,7 @@ def check_pipx_installed():
def install_pipx():
print("Installing pipx...")
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.")
except subprocess.CalledProcessError as e:
print("Error installing pipx:", e, file=sys.stderr)