2017-10-31 20 views
0

Spotipyを使用すると 'current_user_recently_played'はAttributeError: 'Spotifyは' オブジェクト)(無属性 'current_user_saved_tracks'

token = util.prompt_for_user_token(username, scope = scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri) 

sp = spotipy.Spotify(auth = token) 

saved = sp.current_user_saved_tracks() 
print(saved) 
recent = sp.current_user_recently_played() 
print(recent) 

sp.current_user_saved_tracksしようとしていますがありません(sp.current_user_recently_played、うまく動作しますが)明らかに存在しません。それは明らかに文書https://spotipy.readthedocs.io/en/latest/#more-examplesに記載されています。

実行 - v2.4.4 -

おかげで事前に2017年1月4日

Traceback (most recent call last): 
    File "C:\Users\Martin\Google Drive\Python\Spotify\try_req.py", line 19, in <module> 
recent = sp.current_user_recently_played() 
AttributeError: 'Spotify' object has no attribute 'current_user_recently_played' 
+0

https://spotipy.readthedocs.io/en/latest/#spotipy.client.Spotify.current_user_recently_played –

+0

最新バージョンに更新しましたか? –

+0

私がv2.4.4 - 2017年1月4日まで伝えることができる限り、最新のバージョンです。 @cᴏʟᴅsᴘᴇᴇᴅ –

答えて

2

コードを手動で取得する必要があります。 The installation via pip is outdated.

ナビゲートしますSpotipy(私のためにそれがC:\Users\[myName]\AppData\Local\Programs\Python\Python36-32\Lib\site-packages\spotipyだった)、オープンclient.pyをインストールした場所へと新しいコードでコードを置き換えがhereを見つけました。

関連する問題