diff options
| author | David Schulz <david.schulz@qt.io> | 2023-11-22 11:09:41 +0100 |
|---|---|---|
| committer | David Schulz <david.schulz@qt.io> | 2023-12-11 11:39:11 +0000 |
| commit | f4bf7c5b0078831b3fc58882f088c9e6319ffd95 (patch) | |
| tree | 70b3d48394fbb82cfc793cacb2d0104017fb8237 /src/plugins/python/pythonutils.cpp | |
| parent | 67b7835c25a5baa8c6132179c4cbfff34ff8a5fe (diff) | |
Python: show warnings if pip or venv is missing
Change-Id: Ib38c1eb3b0f31d6988d3a5f084ac6eda08ec0619
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
| -rw-r--r-- | src/plugins/python/pythonutils.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index 97d118f1229..d1307a351d3 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -192,4 +192,20 @@ bool isVenvPython(const Utils::FilePath &python) return python.parentDir().parentDir().contains("pyvenv.cfg"); } +bool venvIsUsable(const Utils::FilePath &python) +{ + Process process; + process.setCommand({python, QStringList{"-m", "venv", "-h"}}); + process.runBlocking(); + return process.result() == ProcessResult::FinishedWithSuccess; +} + +bool pipIsUsable(const Utils::FilePath &python) +{ + Process process; + process.setCommand({python, QStringList{"-m", "pip", "-V"}}); + process.runBlocking(); + return process.result() == ProcessResult::FinishedWithSuccess; +} + } // Python::Internal |
