microsoft / Cognitive-Emotion-Python

Python SDK for the Microsoft Emotion API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/emotion-api
Other
64 stars 44 forks source link

Emotion example #3

Closed prasadpagade closed 7 years ago

prasadpagade commented 7 years ago

hi,

While trying to replicate the sample in my Ipython notebook I get the error below when I run the URL or the FROM MY DISK part of the function -


NameError Traceback (most recent call last)

in () 12 params = None 13 ---> 14 result = processRequest( json, data, headers, params ) 15 16 if result is not None: in processRequest(json, data, headers, params) 15 while True: 16 ---> 17 response = requests.request( 'post', _url, json = json, data = data, headers = headers, params = params ) 18 19 if response.status_code == 429: NameError: global name 'requests' is not defined I checked the library and it shows REQUESTS has been already installed. Can you please help. Prasad.
cthrash commented 7 years ago

But did you import requests?

prasadpagade commented 7 years ago

Yes. I resolved the issue. I had to import requests and json together and it worked.

-Prasad

On Mon, Nov 21, 2016 at 8:18 AM, Chris Thrasher notifications@github.com wrote:

But did you import requests?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/Cognitive-Emotion-Python/issues/3#issuecomment-261985554, or mute the thread https://github.com/notifications/unsubscribe-auth/AV8P9ia7F3dwu7RVgPxfu2zm0FOZN166ks5rAcRvgaJpZM4K3ylx .

Regards, Prasad.