diff --git a/src/plugins/python/pythonsettings.cpp b/src/plugins/python/pythonsettings.cpp index 256919b0317..fdd49f9842d 100644 --- a/src/plugins/python/pythonsettings.cpp +++ b/src/plugins/python/pythonsettings.cpp @@ -690,12 +690,15 @@ static QList pythonsFromPath() "python[1-9].[1-9][0-9]", "python[1-9]"}; const FilePaths dirs = Environment::systemEnvironment().path(); + QSet used; for (const FilePath &path : dirs) { const QDir dir(path.toString()); for (const QFileInfo &fi : dir.entryInfoList(filters)) { - const FilePath executable = Utils::FilePath::fromFileInfo(fi); - if (executable.exists()) + const FilePath executable = FilePath::fromUserInput(fi.canonicalFilePath()); + if (!used.contains(executable) && executable.exists()) { + used.insert(executable); pythons << createInterpreter(executable, "Python from Path"); + } } } }