I just coded a Facebook Chatbot running on ngninx ubuntu with pyhthon which worked perfectly until I wanted to add wit.ai to it. The code should work but I think python cant find the module wit although I added it.
Here is the console:
File "/var/www/chatbot/wit.py", line 1, in <module>
from wit import Wit
ImportError: cannot import name 'Wit'
Here is the code of the wit.py:
from wit import Wit
access_token = "*****"
client = Wit(access_token = access_token)
def wit_response(msg):
resp = client.message(msg)
entity = None
value = None
try:
entity = list(resp['entities'])[0]
value = resp['entities'][entity][0]['value']
except:
pass
return (entity, value)