MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / print_env_info

Function print_env_info

scripts/webui_console.py:54–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def print_env_info():
55 which_cmd = "where" if platform.system() == "Windows" else "which"
56
57 python = "python"
58
59 def locate_python():
60 nonlocal python
61
62 python = subprocess.getoutput(f"{which_cmd} python")
63 python = python.split("\n")
64 python = python[0].strip()
65 print("python: ", python)
66
67 locate_python()
68
69 def run(cmd):
70 with subprocess.Popen(cmd) as p:
71 p.wait()
72
73 run([which_cmd, "git"])
74 run(["git", "--version"])
75 run([which_cmd, "python"])
76 run([python, "--version"])
77
78 print(f"PATH={os.environ['PATH']}")
79
80 # if platform.system() == "Windows":
81 # print(f"COMSPEC={os.environ['COMSPEC']}")
82 # print("")
83 # run("wmic path win32_VideoController get name,AdapterRAM,DriverDate,DriverVersion".split(" "))
84
85 print(f"PYTHONPATH={os.environ['PYTHONPATH']}")
86 print("")
87
88
89def open_dev_shell():

Callers 1

webui_console.pyFile · 0.85

Calls 2

locate_pythonFunction · 0.85
runFunction · 0.70

Tested by

no test coverage detected