Yahoo Weather API 2019 - TypeError/AttributeErrorUndocumented Yahoo! Weather API?Yahoo weather-api response as jsonWeather Forcasts from yahoo weather apiYahoo Weather Api LanguageC# with yahoo weather apiYahoo Weather API current conditionsUsing yahoo weather ApiYahoo weather API no Jerzykowo dataYahoo Weather API hourly dataUpdated Yahoo Weather API - .NET

Asking bank to reduce APR instead of increasing credit limit

Cryptography and patents

Working in the USA for living expenses only; allowed on VWP?

How to write a vulnerable moment without it seeming cliche or mushy?

Recording the inputs of a command and producing a list of them later on

Can a helicopter mask itself from Radar?

Infinitely many hats

What TV show or movie did I watch on TV years ago where diseased people are exiled to a spaceship?

Are there mythical creatures in the world of Game of Thrones?

Is there a rule that prohibits us from using 2 possessives in a row?

Coding Challenge Solution - Good Range

What is the most important characteristic of New Weird as a genre?

Looking after a wayward brother in mother's will

PhD student with mental health issues and bad performance

Pros and cons of writing a book review?

If a problem only occurs randomly once in every N times on average, how many tests do I have to perform to be certain that it's now fixed?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Why does the UK have more political parties than the US?

What is the right way to float a home lab?

Modern approach to radio buttons

Slide Partition from Rowstore to Columnstore

Beginner's snake game using PyGame

Are academic associations obliged to comply with the US government?



Yahoo Weather API 2019 - TypeError/AttributeError


Undocumented Yahoo! Weather API?Yahoo weather-api response as jsonWeather Forcasts from yahoo weather apiYahoo Weather Api LanguageC# with yahoo weather apiYahoo Weather API current conditionsUsing yahoo weather ApiYahoo weather API no Jerzykowo dataYahoo Weather API hourly dataUpdated Yahoo Weather API - .NET






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















Want to run Yahoo 2019 Weather API on Raspberry Pi in Python 3.5.3.

Verified Yahoo access codes by successfully running Yahoo sample code for 2.7.10.



All the sample code is from:
https://gist.github.com/VerizonMediaOwner/e6be950f74c5a8071329f1d9a50e3158#file-weather_ydn_sample-py



Ran 2to3 conversion and received the following script TypeError indicated:



#Weather API Python sample code**
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see
#https://opensource.org/licenses/Zlib for terms.**
#$ python --version**
#Python 2.7.10 - AFTER 2TO 3 CONVERSION**

import time, uuid, urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse
import hmac, hashlib
from base64 import b64encode

#Basic info

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
concat = '&'
query = 'location': 'sunnyvale,ca', 'format': 'json'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())

#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])

#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.add_header('Authorization', auth_header)
request.add_header('X-Yahoo-App-Id', app_id)
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather $ python3 yahoo2TO3.py
Traceback (most recent call last):
File "yahoo2.py", line 41, in <module>
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())
File "/usr/lib/python3.5/hmac.py", line 144, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python3.5/hmac.py", line 42, in __init__
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
TypeError: key: expected bytes or bytearray, but got 'str'


Tried the 3.7 code sample and received AttributeError:



#Weather API Python sample code
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see #https://opensource.org/licenses/Zlib for terms.
#$ python --version
#Python 3.7.x

import time, uuid, urllib, json
import hmac, hashlib
from base64 import b64encode

#Basic info

app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
query = 'location': 'macau,mo', 'format': 'json', 'u': 'c'

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
concat = '&'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key.encode('utf-8'), signature_base_str.encode('utf-8'), hashlib.sha1).digest())
#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature.decode('utf-8')
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])
#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.headers['Authorization'] = auth_header
request.headers['X-Yahoo-App-Id']= app_id
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather3 $ python3 yahoo3.py
Traceback (most recent call last):
File "yahoo3.py", line 34, in <module>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
File "yahoo3.py", line 34, in <listcomp>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
AttributeError: module 'urllib' has no attribute 'parse'


Request assistance to run one or the other in 3.5.










share|improve this question
























  • Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

    – balderman
    Mar 24 at 11:48











  • I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

    – Al Adkins
    Mar 25 at 18:37

















1















Want to run Yahoo 2019 Weather API on Raspberry Pi in Python 3.5.3.

Verified Yahoo access codes by successfully running Yahoo sample code for 2.7.10.



All the sample code is from:
https://gist.github.com/VerizonMediaOwner/e6be950f74c5a8071329f1d9a50e3158#file-weather_ydn_sample-py



Ran 2to3 conversion and received the following script TypeError indicated:



#Weather API Python sample code**
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see
#https://opensource.org/licenses/Zlib for terms.**
#$ python --version**
#Python 2.7.10 - AFTER 2TO 3 CONVERSION**

import time, uuid, urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse
import hmac, hashlib
from base64 import b64encode

#Basic info

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
concat = '&'
query = 'location': 'sunnyvale,ca', 'format': 'json'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())

#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])

#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.add_header('Authorization', auth_header)
request.add_header('X-Yahoo-App-Id', app_id)
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather $ python3 yahoo2TO3.py
Traceback (most recent call last):
File "yahoo2.py", line 41, in <module>
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())
File "/usr/lib/python3.5/hmac.py", line 144, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python3.5/hmac.py", line 42, in __init__
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
TypeError: key: expected bytes or bytearray, but got 'str'


Tried the 3.7 code sample and received AttributeError:



#Weather API Python sample code
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see #https://opensource.org/licenses/Zlib for terms.
#$ python --version
#Python 3.7.x

import time, uuid, urllib, json
import hmac, hashlib
from base64 import b64encode

#Basic info

app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
query = 'location': 'macau,mo', 'format': 'json', 'u': 'c'

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
concat = '&'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key.encode('utf-8'), signature_base_str.encode('utf-8'), hashlib.sha1).digest())
#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature.decode('utf-8')
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])
#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.headers['Authorization'] = auth_header
request.headers['X-Yahoo-App-Id']= app_id
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather3 $ python3 yahoo3.py
Traceback (most recent call last):
File "yahoo3.py", line 34, in <module>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
File "yahoo3.py", line 34, in <listcomp>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
AttributeError: module 'urllib' has no attribute 'parse'


Request assistance to run one or the other in 3.5.










share|improve this question
























  • Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

    – balderman
    Mar 24 at 11:48











  • I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

    – Al Adkins
    Mar 25 at 18:37













1












1








1








Want to run Yahoo 2019 Weather API on Raspberry Pi in Python 3.5.3.

Verified Yahoo access codes by successfully running Yahoo sample code for 2.7.10.



All the sample code is from:
https://gist.github.com/VerizonMediaOwner/e6be950f74c5a8071329f1d9a50e3158#file-weather_ydn_sample-py



Ran 2to3 conversion and received the following script TypeError indicated:



#Weather API Python sample code**
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see
#https://opensource.org/licenses/Zlib for terms.**
#$ python --version**
#Python 2.7.10 - AFTER 2TO 3 CONVERSION**

import time, uuid, urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse
import hmac, hashlib
from base64 import b64encode

#Basic info

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
concat = '&'
query = 'location': 'sunnyvale,ca', 'format': 'json'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())

#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])

#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.add_header('Authorization', auth_header)
request.add_header('X-Yahoo-App-Id', app_id)
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather $ python3 yahoo2TO3.py
Traceback (most recent call last):
File "yahoo2.py", line 41, in <module>
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())
File "/usr/lib/python3.5/hmac.py", line 144, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python3.5/hmac.py", line 42, in __init__
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
TypeError: key: expected bytes or bytearray, but got 'str'


Tried the 3.7 code sample and received AttributeError:



#Weather API Python sample code
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see #https://opensource.org/licenses/Zlib for terms.
#$ python --version
#Python 3.7.x

import time, uuid, urllib, json
import hmac, hashlib
from base64 import b64encode

#Basic info

app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
query = 'location': 'macau,mo', 'format': 'json', 'u': 'c'

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
concat = '&'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key.encode('utf-8'), signature_base_str.encode('utf-8'), hashlib.sha1).digest())
#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature.decode('utf-8')
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])
#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.headers['Authorization'] = auth_header
request.headers['X-Yahoo-App-Id']= app_id
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather3 $ python3 yahoo3.py
Traceback (most recent call last):
File "yahoo3.py", line 34, in <module>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
File "yahoo3.py", line 34, in <listcomp>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
AttributeError: module 'urllib' has no attribute 'parse'


Request assistance to run one or the other in 3.5.










share|improve this question
















Want to run Yahoo 2019 Weather API on Raspberry Pi in Python 3.5.3.

Verified Yahoo access codes by successfully running Yahoo sample code for 2.7.10.



All the sample code is from:
https://gist.github.com/VerizonMediaOwner/e6be950f74c5a8071329f1d9a50e3158#file-weather_ydn_sample-py



Ran 2to3 conversion and received the following script TypeError indicated:



#Weather API Python sample code**
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see
#https://opensource.org/licenses/Zlib for terms.**
#$ python --version**
#Python 2.7.10 - AFTER 2TO 3 CONVERSION**

import time, uuid, urllib.request, urllib.parse, urllib.error, urllib.request, urllib.error, urllib.parse
import hmac, hashlib
from base64 import b64encode

#Basic info

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
concat = '&'
query = 'location': 'sunnyvale,ca', 'format': 'json'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())

#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])

#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.add_header('Authorization', auth_header)
request.add_header('X-Yahoo-App-Id', app_id)
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather $ python3 yahoo2TO3.py
Traceback (most recent call last):
File "yahoo2.py", line 41, in <module>
oauth_signature = b64encode(hmac.new(composite_key, signature_base_str, hashlib.sha1).digest())
File "/usr/lib/python3.5/hmac.py", line 144, in new
return HMAC(key, msg, digestmod)
File "/usr/lib/python3.5/hmac.py", line 42, in __init__
raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)
TypeError: key: expected bytes or bytearray, but got 'str'


Tried the 3.7 code sample and received AttributeError:



#Weather API Python sample code
#Copyright 2019 Oath Inc. Licensed under the terms of the zLib license see #https://opensource.org/licenses/Zlib for terms.
#$ python --version
#Python 3.7.x

import time, uuid, urllib, json
import hmac, hashlib
from base64 import b64encode

#Basic info

app_id = 'XXX'
consumer_key = 'XXX'
consumer_secret = 'XXX'
query = 'location': 'macau,mo', 'format': 'json', 'u': 'c'

url = 'https://weather-ydn-yql.media.yahoo.com/forecastrss'
method = 'GET'
concat = '&'
oauth =
'oauth_consumer_key': consumer_key,
'oauth_nonce': uuid.uuid4().hex,
'oauth_signature_method': 'HMAC-SHA1',
'oauth_timestamp': str(int(time.time())),
'oauth_version': '1.0'


#Prepare signature string (merge all params and SORT them)

merged_params = query.copy()
merged_params.update(oauth)
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
signature_base_str = method + concat + urllib.parse.quote(url, safe='') + concat + urllib.parse.quote(concat.join(sorted_params), safe='')

#Generate signature

composite_key = urllib.parse.quote(consumer_secret, safe='') + concat
oauth_signature = b64encode(hmac.new(composite_key.encode('utf-8'), signature_base_str.encode('utf-8'), hashlib.sha1).digest())
#Prepare Authorization header

oauth['oauth_signature'] = oauth_signature.decode('utf-8')
auth_header = 'OAuth ' + ', '.join(['=""'.format(k,v) for k,v in oauth.items()])
#Send request

url = url + '?' + urllib.parse.urlencode(query)
request = urllib.request.Request(url)
request.headers['Authorization'] = auth_header
request.headers['X-Yahoo-App-Id']= app_id
response = urllib.request.urlopen(request).read()
print(response)

ERROR:
pi@raspberrypi:~/Weather3 $ python3 yahoo3.py
Traceback (most recent call last):
File "yahoo3.py", line 34, in <module>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
File "yahoo3.py", line 34, in <listcomp>
sorted_params = [k + '=' + urllib.parse.quote(merged_params[k], safe='') for k in sorted(merged_params.keys())]
AttributeError: module 'urllib' has no attribute 'parse'


Request assistance to run one or the other in 3.5.







python python-3.x yahoo-weather-api






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 11:22









Vadim Kotov

5,04673550




5,04673550










asked Mar 24 at 11:19









Al AdkinsAl Adkins

263




263












  • Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

    – balderman
    Mar 24 at 11:48











  • I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

    – Al Adkins
    Mar 25 at 18:37

















  • Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

    – balderman
    Mar 24 at 11:48











  • I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

    – Al Adkins
    Mar 25 at 18:37
















Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

– balderman
Mar 24 at 11:48





Why dont you use requests in as the HTTP client library? See docs.python-requests.org/en/master

– balderman
Mar 24 at 11:48













I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

– Al Adkins
Mar 25 at 18:37





I believe your suggestion is a valid direction. I added the requests library to my Python 3 and 'import requests' at the header of the test file. I have researched and tried a variety of configurations but keep getting 'TypeError: 'tuple' object is not callable'. This may relate to trying to pass three security codes Id, Key and Secret to access the file?

– Al Adkins
Mar 25 at 18:37












1 Answer
1






active

oldest

votes


















2














RESOLVED:
In the sample code for Python 3.7 change the header import urllib to import urllib.request. After this change it works just fine using Raspberry Pi Python 3.5.3.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323246%2fyahoo-weather-api-2019-typeerror-attributeerror%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    RESOLVED:
    In the sample code for Python 3.7 change the header import urllib to import urllib.request. After this change it works just fine using Raspberry Pi Python 3.5.3.






    share|improve this answer





























      2














      RESOLVED:
      In the sample code for Python 3.7 change the header import urllib to import urllib.request. After this change it works just fine using Raspberry Pi Python 3.5.3.






      share|improve this answer



























        2












        2








        2







        RESOLVED:
        In the sample code for Python 3.7 change the header import urllib to import urllib.request. After this change it works just fine using Raspberry Pi Python 3.5.3.






        share|improve this answer















        RESOLVED:
        In the sample code for Python 3.7 change the header import urllib to import urllib.request. After this change it works just fine using Raspberry Pi Python 3.5.3.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 26 at 21:06









        nick

        6821619




        6821619










        answered Mar 26 at 20:35









        Al AdkinsAl Adkins

        263




        263





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323246%2fyahoo-weather-api-2019-typeerror-attributeerror%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현