Problem with generate_user_credentials.py

450 views
Skip to first unread message

Miguel Angel Garcia

unread,
Jun 22, 2022, 7:12:29 AM6/22/22
to Google Ads API and AdWords API Forum
I'm following the instructions on https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-web to generate the refresh token 

The instructions says to run "generate_user_credentials.py ..." in the terminal, but all my terminals (VS Code, command prompt, Powershell) says that generate_user_credentials.py is not a valid command (in Spanish it says "no se reconoce como nombre de un cmdlet, función, archivo de script o programa ejecutable"). 

I have already installed the Python Client library on my local machine (with "pip install google-ads") and I see all the "/google/ads/" files installed, but I don't see any of the "/examples/" files and I can't find the "generate_user_credentials.py" anywhere in my machine. 

Do I have to add the example files manually? 
They should be added to a certain path or folder? 
Do I have to do any extra steps or configurations to make the example files work?

(I'm using Python, Django, VS Code and Windows 10. And I'm a super noobie, I guess it's quite clear from my questions). 😅

Thanks! 

Google Ads API Forum Advisor

unread,
Jun 22, 2022, 1:59:06 PM6/22/22
to delval...@gmail.com, adwor...@googlegroups.com
Hi Migual,

Thank you for reaching out to the Google Ads API support team.

With regards to your concern, you can download client library and go into the directly where the generate_user_credentials.py is located then run it. And second option it, you can use an IDE for Python to run that example. For the python client library further questions, I recommend you to reach out to the Python client library owner by filing an issue on the issue tracker on the issue tab of your client library on the github, so that they can provide guidance on it.

Thanks,
Google Logo
Nirmitabahen Gaurav
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bz0zL:ref

Miguel Angel Garcia

unread,
Jun 23, 2022, 12:24:54 PM6/23/22
to Google Ads API and AdWords API Forum
So the API examples are designed to be run as "independent files", not to use their functions inside a Python/Ruby/whatever app?

Google Ads API Forum Advisor

unread,
Jun 23, 2022, 8:18:14 PM6/23/22
to delval...@gmail.com, adwor...@googlegroups.com
Hi Miguel,

Thank you for the reply.  I am also a member of the Google Ads API team and let me provide support to your concern.

Upon checking, I can see that the generate_user_credentials.py appears to have dependencies with the other unit so I would suggest running it inside the Python client library. However, to further troubleshoot the issue, the directory where the said unit is stored in this path google-ads-python/examples/authentication/generate_user_credentials.py based here. With this, could you try running that unit on said directory?

If the issue persists, I would suggest also reaching out to the author of the Python client library via this Github Python issue tracker to get support. The author of the Python client library is more equipped to this matter.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2bz0zL:ref
Reply all
Reply to author
Forward
0 new messages