Skip to content

Commit a86fd73

Browse files
committed
Fix path to python executable on Windows
Fix #8
1 parent 3110ed4 commit a86fd73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/package_command.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'dart:io';
33

44
import 'package:archive/archive_io.dart';
55
import 'package:args/command_runner.dart';
6+
import 'package:flutter/foundation.dart';
67
import 'package:http/http.dart' as http;
78
import 'package:path/path.dart' as path;
89
import 'package:toml/toml.dart';
@@ -260,7 +261,9 @@ class PackageCommand extends Command {
260261
}
261262

262263
// Run the python executable
263-
var pythonPath = path.join(pythonDir.path, 'python', 'bin', 'python3');
264+
var pythonPath = defaultTargetPlatform == TargetPlatform.windows
265+
? path.join(pythonDir.path, 'python', 'python.exe')
266+
: path.join(pythonDir.path, 'python', 'bin', 'python3');
264267
return await runExec(pythonPath, args, environment: environment);
265268
}
266269
}

0 commit comments

Comments
 (0)