Add import checks for pip dependencies.
Test: Ran `python scripts/update_profiles.py --help`
Change-Id: I3ecca1f396b12faa324d109c3892ae9cb65dd784
diff --git a/scripts/android_build_client.py b/scripts/android_build_client.py
index 443011e..0e1feb4 100644
--- a/scripts/android_build_client.py
+++ b/scripts/android_build_client.py
@@ -1,6 +1,33 @@
-import apiclient.discovery
-import apiclient.http
-from oauth2client import client as oauth2_client
+#!/usr/bin/env python
+#
+# Copyright (C) 2019 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+try:
+ import apiclient.discovery
+ import apiclient.http
+ from oauth2client import client as oauth2_client
+except ImportError:
+ missingImportString = '''
+ Missing necessary libraries. Try doing the following:
+ $ sudo apt-get install python-pip
+ $ sudo pip install --upgrade google-api-python-client
+ $ sudo pip install --upgrade oauth2client
+'''
+ raise ImportError(missingImportString)
+
import io
import os