| 2737 | } |
| 2738 | |
| 2739 | void SamApp::InstallPython() { |
| 2740 | if (pythonConfig.pythonVersion.empty() && pythonConfig.minicondaVersion.empty()) |
| 2741 | LoadPythonConfig(); |
| 2742 | |
| 2743 | auto python_path = GetPythonConfigPath(); |
| 2744 | // already installed and correctly configured |
| 2745 | if (CheckPythonInstalled(pythonConfig)){ |
| 2746 | set_python_path(python_path.c_str()); |
| 2747 | return; |
| 2748 | } |
| 2749 | |
| 2750 | #ifdef __WXMSW__ |
| 2751 | // windows |
| 2752 | bool errors = InstallPythonWindows(python_path, pythonConfig); |
| 2753 | #else |
| 2754 | bool errors = InstallPythonUnix(python_path, pythonConfig); |
| 2755 | #endif |
| 2756 | if (errors) |
| 2757 | throw std::runtime_error("Error installing python."); |
| 2758 | LoadPythonConfig(); |
| 2759 | } |
| 2760 | |
| 2761 | void SamApp::InstallPythonPackage(const std::string& pip_name) { |
| 2762 | if (CheckPythonPackageInstalled(pip_name, pythonConfig)) |
nothing calls this directly
no test coverage detected