googleads-python-lib icon indicating copy to clipboard operation
googleads-python-lib copied to clipboard

module 'googleads.oauth2' has no attribute

Open mgallivan-loknow opened this issue 6 years ago • 2 comments

When running the access token example, I receive the error

AttributeError: module 'googleads.oauth2' has no attribute 'GetAPIScope'

However, I can run the following without issue

from googleads import oauth2

I install the library using pip install googleads and all the necessary files, including oauth2.py, can be found inside

/Users/username/DevEnv/lib/python3.7/site-packages/googleads/

Does this have something to do with how I import the package, or am I using an old example?

mgallivan-loknow avatar Apr 16 '19 17:04 mgallivan-loknow

I should also note that running the folllowing

from googleads import oauth2
import sys, inspect
for name, obj in inspect.getmembers(sys.modules["googleads.oauth2"]):
    if inspect.isclass(obj):
        print(obj)

results in the expected

<class 'googleads.oauth2.GoogleAccessTokenClient'>
<class 'googleads.oauth2.GoogleOAuth2Client'>
<class 'googleads.oauth2.GoogleRefreshTokenClient'>
<class 'googleads.oauth2.GoogleRefreshableOAuth2Client'>
<class 'googleads.oauth2.GoogleServiceAccountClient'>

mgallivan-loknow avatar Apr 16 '19 17:04 mgallivan-loknow

@mgallivan-loknow sorry for the delayed response. Can you share the full stack trace you're getting? Also how are you executing the example? Is it via a bash command line?

BenRKarl avatar Jul 09 '19 20:07 BenRKarl