MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / ensure_python_deps

Function ensure_python_deps

Scripts/Developer Base/Free Internet.py:95–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94
95def ensure_python_deps() -> None:
96 missing = []
97 try:
98 import flask # noqa: F401
99 except Exception:
100 missing.append("flask")
101 try:
102 import requests # noqa: F401
103 except Exception:
104 missing.append("requests")
105 if not missing:
106 return
107 if is_termux() and which("pkg"):
108 _run(["pkg", "update", "-y"])
109 _run(["pkg", "install", "-y", "python"])
110 if not _run([sys.executable, "-m", "pip", "install", "--upgrade", *missing]):
111 print("Failed to install Python dependencies.")
112 print("Try in Termux:")
113 print(" pkg install python")
114 print(" pip install flask requests")
115 sys.exit(1)
116 os.execv(sys.executable, [sys.executable] + sys.argv)
117
118
119def ensure_openssl() -> None:

Callers 1

Free Internet.pyFile · 0.70

Calls 4

printFunction · 0.85
is_termuxFunction · 0.70
whichFunction · 0.70
_runFunction · 0.70

Tested by

no test coverage detected