Hi,
Based on the stack trace you provided, the error is occurring because you
do not have permissions to the local directory containing trusted
certificates.
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py",
line 507, in __init__
self._context.load_verify_locations(ca_certs)
IOError: [Errno 13] Permission denied
Please try granting your user permissions to that directory. If that does
not resolve the problem, please open an issue on the Python library's
github page <https://github.com/googleads/googleads-python-lib/issues> and
we'll proceed from there.
Thanks,
Josh, AdWords API Team
On Thursday, April 23, 2015 at 7:18:03 PM UTC-4, [email protected] wrote:
>
> I am trying the following script and getting an error that permission is
> denied and that is it? This api is so convoluted it almost defeats it's
> purpose!
>
> >>> from googleads import adwords
> >>> from googleads import oauth2
> >>> CLIENT_ID = '336187065250-xxxxx.apps.googleusercontent.com'
> >>> CLIENT_SECRET = 'ELINLJVnPa_onW6xxxxxxx'
> >>> REFRESH_TOKEN =
> '1/pRYXYjPfU67nhpKfoYBcEJpKkEgOJifHX5xdqP9kYGAMxxxxxxxxxx'
> >>> DEVELOPER_TOKEN = 'aLoCgx9n5vOmqUxxxxx'
> >>> USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2)
> AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'
> >>> CLIENT_CUSTOMER_ID = '338-105-xxxx'
> >>> def main(client_id, client_secret, refresh_token, developer_token,
> user_agent,
> client_customer_id):
> oauth2_client = oauth2.GoogleRefreshTokenClient(
> client_id, client_secret, refresh_token)
>
> adwords_client = adwords.AdWordsClient(
> developer_token, oauth2_client, user_agent, client_customer_id)
>
> customer = adwords_client.GetService('CustomerService').get()
> print 'You are logged in as customer: %s' % customer['customerId']
>
> >>> if __name__ == '__main__':
> main(CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN, DEVELOPER_TOKEN,
> USER_AGENT,
> CLIENT_CUSTOMER_ID)
>
> and getting this error - how do I fix this?
> .
> ..
> ...
> .....
> Traceback (most recent call last):
> File "<pyshell#16>", line 3, in <module>
> CLIENT_CUSTOMER_ID)
> File "<pyshell#14>", line 9, in main
> customer = adwords_client.GetService('CustomerService').get()
> File "/Library/Python/2.7/site-packages/googleads/common.py", line 294,
> in MakeSoapRequest
> self._header_handler.SetHeaders(self.suds_client)
> File "/Library/Python/2.7/site-packages/googleads/adwords.py", line 331,
> in SetHeaders
> headers=self._adwords_client.oauth2_client.CreateHttpHeader())
> File "/Library/Python/2.7/site-packages/googleads/oauth2.py", line 150,
> in CreateHttpHeader
> self.Refresh()
> File "/Library/Python/2.7/site-packages/googleads/oauth2.py", line 166,
> in Refresh
> self.disable_ssl_certificate_validation)))
> File
> "/Library/Python/2.7/site-packages/oauth2client-1.4.6-py2.7.egg/oauth2client/client.py",
>
> line 573, in refresh
> self._refresh(http.request)
> File
> "/Library/Python/2.7/site-packages/oauth2client-1.4.6-py2.7.egg/oauth2client/client.py",
>
> line 744, in _refresh
> self._do_refresh_request(http_request)
> File
> "/Library/Python/2.7/site-packages/oauth2client-1.4.6-py2.7.egg/oauth2client/client.py",
>
> line 773, in _do_refresh_request
> self.token_uri, method='POST', body=body, headers=headers)
> File
> "/Library/Python/2.7/site-packages/httplib2-0.9-py2.7.egg/httplib2/__init__.py",
>
> line 1593, in request
> (response, content) = self._request(conn, authority, uri, request_uri,
> method, body, headers, redirections, cachekey)
> File
> "/Library/Python/2.7/site-packages/httplib2-0.9-py2.7.egg/httplib2/__init__.py",
>
> line 1335, in _request
> (response, content) = self._conn_request(conn, request_uri, method,
> body, headers)
> File
> "/Library/Python/2.7/site-packages/httplib2-0.9-py2.7.egg/httplib2/__init__.py",
>
> line 1257, in _conn_request
> conn.connect()
> File
> "/Library/Python/2.7/site-packages/httplib2-0.9-py2.7.egg/httplib2/__init__.py",
>
> line 1021, in connect
> self.disable_ssl_certificate_validation, self.ca_certs)
> File
> "/Library/Python/2.7/site-packages/httplib2-0.9-py2.7.egg/httplib2/__init__.py",
>
> line 80, in _ssl_wrap_socket
> cert_reqs=cert_reqs, ca_certs=ca_certs)
> File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py",
> line 891, in wrap_socket
> ciphers=ciphers)
> File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py",
> line 507, in __init__
> self._context.load_verify_locations(ca_certs)
> IOError: [Errno 13] Permission denied
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/d7b3ba60-fb85-4b48-9402-488dda01d2b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.