2017-05-26 64 views
0

嗨!Tweepy得到TypeError:'int'類型的參數不可迭代

我遇到的問題與Tweepy功能searchsearch_users:當我啓動我的小片的下面的代碼:

auth = tweepy.auth.OAuthHandler(creds["consumer_key"], creds["consumer_secret"]) 
auth.secure = True 
auth.set_access_token(creds["access_token"], creds["access_token_secret"]) 

api = tweepy.API(auth, wait_on_rate_limit=True,wait_on_rate_limit_notify=True,retry_count=10,retry_delay=5,retry_errors=5) 
#The error is the same for 'search_users & 'search' 
res = api.search_users(q="Hello",count=10) 
res = api.search(q="Hello",count=10) 

它給了我下面的錯誤:

Traceback (most recent call last): 
File "/projects/twitter/twitter/common/search.py", line 14, in searchUser 
res = api.search_users(q="Hello",count=10) 
File "/projects/twitter/lib/python3.5/site-packages/tweepy-3.6.0-py3.5.egg/tweepy/binder.py", line 250, in _call 
File "/projects/twitter/lib/python3.5/site-packages/tweepy-3.6.0-py3.5.egg/tweepy/binder.py", line 214, in execute 

TypeError: argument of type 'int' is not iterable 

注意:我目前正在使用virtualenv,但我認爲這個問題沒有關係。

注2:這個問題是一樣的Tweepy版本3.5 & 3.6

有人能幫我強調我做錯了什麼? :/

回答

0

Search_users不採用count的說法。只需運行api.search_users(q="Hello"),您應該找回與該字符串匹配的用戶列表。

+0

實際上,count參數存在:)你可以在這裏的程序中看到它:https://github.com/tweepy/tweepy/blob/master/tweepy/api.py#L351 – toshiro92

相關問題