简体   繁体   English

AttributeError Spotipy

[英]AttributeError Spotipy

Earlier today I had no problem accessing the Spotipy API but all of a sudden it stopped working.今天早些时候,我在访问 Spotipy API 时没有遇到任何问题,但突然间它停止工作了。 When I forexample run the following:例如,当我运行以下命令时:

spotipy.artist("5rSXSAkZ67PYJSvpUpkOr7")

Where 5rSXSAkZ67PYJSvpUpkOr7 is the Spotify ID of an artist, I get the error:其中5rSXSAkZ67PYJSvpUpkOr7是艺术家的 Spotify ID,我收到错误消息:

AttributeError: module 'spotipy' has no attribute 'artist'

The closest thing to an explanation I have found is this thread .我找到的最接近解释的是这个线程 But I don't completely understand the solution.但我不完全理解解决方案。

Your spotify is apparently the module and not the object of spotify_obj = spotify.Spotify() class.您的spotify显然是模块,而不是spotify_obj = spotify.Spotify() class 的 object。

spotify_obj has artist attribute. spotify_obj具有artist属性。 spotify module does not. spotify模块没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM