Reputation: 21
Hi I am new to Python... I am trying to use YQL using Python. I installed httplib2-0.7.0, oauth2 and then installed yql package
For this sample code :
import yql
y = yql.Public()
query = 'select * from flickr.photos.search where text="panda" limit 3';
result = y.execute(query)
print result
I got the following error message.
Please help!!
Traceback (most recent call last):
File "test.py", line 4, in result = y.execute(query)
File "C:\Python27\lib\site-packages\yql-0.7-py2.7.egg\yql__init__.py", line 306, in execute resp, content = self.http.request(url, http_method)
File "C:\Python27\lib\site-packages\httplib2__init__.py", line 1436, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey )
File "C:\Python27\lib\site-packages\httplib2__init__.py", line 1188, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "C:\Python27\lib\site-packages\httplib2__init__.py", line 1123, in _conn_request conn.connect()
File "C:\Python27\lib\site-packages\httplib2__init__.py", line 890, in connect self.disable_ssl_certificate_validation, self.ca_certs)
File "C:\Python27\lib\site-packages\httplib2__init__.py", line 76, in _ssl_wrap_socket cert_reqs=cert_reqs, ca_certs=ca_certs)
File "C:\Python27\lib\ssl.py", line 344, in wrap_socket ciphers=ciphers)
File "C:\Python27\lib\ssl.py", line 119, in init ciphers)
ssl.SSLError: [Errno 185090050] _ssl.c:336: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
When I tried to use the *twitter python wrapper, I ended up getting the same SSL error.*
Please tell me what to do
Upvotes: 2
Views: 306
Reputation: 10721
I can see two likely issues:
SSL Certificate
I'm not familiar with Python or that library you're using, but the error sounds like it can't verify the SSL certificate. (Possibly because there is no suitable local SSL certificate bundle for authentication.) You may be able to configure it to skip the SSL certificate verification.
YQL Flickr Query
The YQL query is not correct and gives an error in the YQL console:
select * from flickr.photos.search where text="panda" limit 3
Actually, given the age of this question, it may have worked in June 2011. Now the Flickr tables require an API key as well, so the working query would look like:
select * from flickr.photos.search where text="panda" and api_key="insert-your-key-here" limit 3
Upvotes: 0