@@ -105,7 +105,8 @@ class DoctorService implements IDoctorService {
105
105
106
106
let androidToolsIssues = this . $androidToolsInfo . validateInfo ( ) ;
107
107
let javaVersionIssue = await this . $androidToolsInfo . validateJavacVersion ( sysInfo . javacVersion ) ;
108
- let doctorResult = result || androidToolsIssues || javaVersionIssue ;
108
+ let pythonIssues = await this . validatePythonPackages ( ) ;
109
+ let doctorResult = result || androidToolsIssues || javaVersionIssue || pythonIssues ;
109
110
110
111
if ( ! configOptions || configOptions . trackResult ) {
111
112
await this . $analyticsService . track ( "DoctorEnvironmentSetup" , doctorResult ? "incorrect" : "correct" ) ;
@@ -213,5 +214,25 @@ class DoctorService implements IDoctorService {
213
214
spinner . stop ( ) ;
214
215
}
215
216
}
217
+
218
+ private async validatePythonPackages ( ) : Promise < boolean > {
219
+ let hasInvalidPackages = false ;
220
+ if ( this . $hostInfo . isDarwin ) {
221
+ try {
222
+ let queryForSixPackage = await this . $childProcess . exec ( `pip freeze | grep '^six=' | wc -l` ) ;
223
+ let sixPackagesFoundCount = parseInt ( queryForSixPackage ) ;
224
+ if ( sixPackagesFoundCount === 0 ) {
225
+ hasInvalidPackages = true ;
226
+ this . $logger . warn ( "The Python 'six' package not found." ) ;
227
+ this . $logger . out ( "This package is required by the Debugger library (LLDB) for iOS. You can install it by running 'pip install six' from the terminal." ) ;
228
+ }
229
+ } catch ( error ) {
230
+ this . $logger . warn ( "Couldn't retrieve installed python packages." ) ;
231
+ this . $logger . out ( "We cannot verify your python installation is setup correctly. Please, make sure you have both 'python' and 'pip' installed." ) ;
232
+ this . $logger . trace ( `Error while validating Python packages. Error is: ${ error . message } ` ) ;
233
+ }
234
+ }
235
+ return hasInvalidPackages ;
236
+ }
216
237
}
217
238
$injector . register ( "doctorService" , DoctorService ) ;
0 commit comments