【发布时间】:2016-12-22 21:22:51
【问题描述】:
我正在使用 python 将数据导入到运行 predictionio 的服务器上。
我正在使用以下代码来设置 EventClient:
import predictionio
client = predictionio.EventClient(
access_key='285',
url='http://localhost:7070',
threads=5,
qsize=500)
client.create_event(
event="rate",
entity_type="user",
entity_id="Bob",
target_entity_type="item",
target_entity_id="Fred",
properties= { "rating" : 5.0 }
)
但我不断收到以下消息:
python imp.py
Traceback (most recent call last):
File "imp.py", line 6, in <module>
qsize=500)
File "C:\...\predictioni
"It seems like you are specifying an app_id. It is deprecate
DeprecationWarning: It seems like you are specifying an app_id.
ss_key instead. Or, you may use an earlier version of this sdk.
我显然没有指定应用程序 ID,因为我正在向客户端传递一个命名参数:“access_key”。删除qsizeargument 没有任何作用,错误只会归咎于上面的行,依此类推。我在documentation 中找不到任何东西,这可能是因为我对这一切都很陌生,所以我找不到哪里出错了。
我一直在看的所有教程都以这种方式创建 EventClients 并且没有问题:
http://predictionio.incubator.apache.org/datacollection/eventapi/
任何帮助将不胜感激。谢谢。
【问题讨论】:
-
"或者你可以使用这个sdk的早期版本"...试试
pip install --upgrade predictionio -
我将其理解为“如果您想指定应用名称,请使用早期版本的 sdk”。我今天安装了 predictionio,所以它绝对是最新的,我运行了你给出的命令来确定。还是什么都没有
-
这也可能意味着 :) 我将其解读为“弃用警告......您可能使用的是早期版本”。
标签: python localhost predictionio