MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / InstallFromPipWindows

Function InstallFromPipWindows

src/pythonhandler.cpp:200–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198
199#ifdef __WXMSW__
200int InstallFromPipWindows(const std::string& pip_exec, const PythonPackageConfig& package){
201 std::string args = " install " + package.name + "==" + package.version;
202 PROCESS_INFORMATION p_info;
203 STARTUPINFO s_info;
204 DWORD ReturnValue;
205 CA2T programpath(pip_exec.c_str());
206 CA2T programargs(args.c_str());
207
208 memset(&s_info, 0, sizeof(s_info));
209 memset(&p_info, 0, sizeof(p_info));
210 s_info.cb = sizeof(s_info);
211
212 if (CreateProcess(programpath, programargs, NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &s_info, &p_info)) {
213 WaitForSingleObject(p_info.hProcess, INFINITE);
214 GetExitCodeProcess(p_info.hProcess, &ReturnValue);
215 CloseHandle(p_info.hProcess);
216 CloseHandle(p_info.hThread);
217 }
218 return ReturnValue;
219}
220#endif
221
222int InstallFromPip(const std::string& pip_exec, const PythonPackageConfig& package){

Callers 1

InstallPythonPackageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected