【发布时间】:2016-01-26 22:24:57
【问题描述】:
我需要运行 twitter api 调用以查找友谊。通话详情在这里:
https://dev.twitter.com/docs/api/1.1/get/friendships/lookup
我在 python 中使用 tweepy 来执行此操作,但是,它根本不存在于 tweepy 中。我做了一点挖掘,发现这个方法已经添加到 tweepy 并且我有最新版本。检查这个:
https://github.com/tweepy/tweepy/commit/aa055fe16c73f80a0a36279bfc83e40af3d93008
每当我尝试运行 api.lookup_friendship 时。它在代码中不存在。有什么办法可以让它工作吗?
【问题讨论】:
-
你能确认
python -c 'import tweepy; print tweepy.__version__'给你1.11吗? -
@Martijn Pieters 另外一点,我在 mac osx 山狮上。 tweepy 的源文件在哪里?我可以从 git 中添加代码,不是吗?
-
使用 bin/python -c 'import tweepy;打印 tweepy.__file__';我可以确认 1.11 缺少该方法,奇怪。
-
能否贴出不起作用的示例代码?
-
@AndreBossard:
import tweepy; api = tweepy.API(); api.lookup_friendships()->AttributeError: 'API' object has no attribute 'lookup_friendships'。 1.11 发行版中包含的api.py文件中没有定义这样的函数。