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

Function configure_env

scripts/webui_console.py:6–51  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

4
5
6def configure_env(dir):
7 env_entries = {
8 "PATH": [
9 f"{dir}",
10 f"{dir}/bin",
11 f"{dir}/Library/bin",
12 f"{dir}/Scripts",
13 f"{dir}/usr/bin",
14 ],
15 "PYTHONPATH": [
16 f"{dir}",
17 f"{dir}/lib/site-packages",
18 f"{dir}/lib/python3.10/site-packages",
19 ],
20 "PYTHONHOME": [],
21 "PY_LIBS": [
22 f"{dir}/Scripts/Lib",
23 f"{dir}/Scripts/Lib/site-packages",
24 f"{dir}/lib",
25 f"{dir}/lib/python3.10/site-packages",
26 ],
27 "PY_PIP": [f"{dir}/Scripts", f"{dir}/bin"],
28 }
29
30 if platform.system() == "Windows":
31 env_entries["PATH"].append("C:/Windows/System32")
32 env_entries["PATH"].append("C:/Windows/System32/wbem")
33 env_entries["PYTHONNOUSERSITE"] = ["1"]
34 env_entries["PYTHON"] = [f"{dir}/python"]
35 env_entries["GIT"] = [f"{dir}/Library/bin/git"]
36 else:
37 env_entries["PATH"].append("/bin")
38 env_entries["PATH"].append("/usr/bin")
39 env_entries["PATH"].append("/usr/sbin")
40 env_entries["PYTHONNOUSERSITE"] = ["y"]
41 env_entries["PYTHON"] = [f"{dir}/bin/python"]
42 env_entries["GIT"] = [f"{dir}/bin/git"]
43
44 env = {}
45 for key, paths in env_entries.items():
46 paths = [p.replace("/", os.path.sep) for p in paths]
47 paths = os.pathsep.join(paths)
48
49 os.environ[key] = paths
50
51 return env
52
53
54def print_env_info():

Callers 1

webui_console.pyFile · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected