Skip to content

Commit 3e928b1

Browse files
committed
Handle "Could not find distutils module" error (issue #85)
1 parent 5d7484d commit 3e928b1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/installer/get-python.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import zlib from 'zlib';
2424
export async function findPythonExecutable() {
2525
const exenames = proc.IS_WINDOWS ? ['python.exe'] : ['python3', 'python'];
2626
const envPath = process.env.PLATFORMIO_PATH || process.env.PATH;
27+
const errors = [];
2728
for (const location of envPath.split(path.delimiter)) {
2829
for (const exename of exenames) {
2930
const executable = path.normalize(path.join(location, exename)).replace(/"/g, '');
@@ -36,9 +37,15 @@ export async function findPythonExecutable() {
3637
}
3738
} catch (err) {
3839
console.warn(executable, err);
40+
errors.push(err);
3941
}
4042
}
4143
}
44+
for (const err of errors) {
45+
if (err.toString().includes('Could not find distutils module')) {
46+
throw err;
47+
}
48+
}
4249
return null;
4350
}
4451

src/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export function getErrorReportUrl(title, description) {
8383
'https://github.com/platformio/platformio-vscode-ide/issues/205',
8484
],
8585
[
86-
'missed `distutils`',
86+
'Could not find distutils module',
8787
'https://github.com/platformio/platformio-core-installer/issues/85',
8888
],
8989
[

0 commit comments

Comments
 (0)