只是試圖用Wit.ai & Python進行實驗,但得到以下錯誤。我在這裏做錯了什麼?'Wit'對象沒有任何屬性'message'
錯誤:
Traceback (most recent call last):
File "C:/Python27/mx1.py", line 7, in <module>
resp = client.message(my_message)
AttributeError: 'Wit' object has no attribute 'message'
代碼:
from wit import Wit
access_token='B3GHXHLTXIASO7S4KY7UC65LMSTCDEHK'
client = Wit(access_token)
my_message='who are you?'
resp = client.message(my_message)
print(resp)
你的例子對我來說工作得很好(響應包含'我是Jarvis'),但我在Linux上。你能告訴我們你是如何安裝Wit庫的? – randomir
我在Win10上運行Python 2.7。我使用「pip install pywit」進行安裝。 – user3289968
[docs](https://github.com/wit-ai/pywit#install)說'pip install wit'。 – randomir