Add another check for a failed googleapiclient upgrade.
This adds one more check for a failed 1.2 -> 1.3 upgrade, specifically in the
`apiclient` import (which was the only import available in 1.2). Even combined
with the check in setup.py, this won't catch everything, but it now covers all
the most common cases.
diff --git a/apiclient/__init__.py b/apiclient/__init__.py
index 9577a5e..5db22a1 100644
--- a/apiclient/__init__.py
+++ b/apiclient/__init__.py
@@ -2,6 +2,17 @@
import googleapiclient
+try:
+ import oauth2client
+except ImportError:
+ raise RuntimeError(
+ 'Previous version of google-api-python-client detected; due to a '
+ 'packaging issue, we cannot perform an in-place upgrade. To repair, '
+ 'remove and reinstall this package, along with oauth2client and '
+ 'uritemplate. One can do this with pip via\n'
+ ' pip install -I google-api-python-client'
+ )
+
from googleapiclient import channel
from googleapiclient import discovery
from googleapiclient import errors