scope = 'user-read-private'
myClientId = "[ur id]"
mySecret = "[ur secret]"
myRedirect="http://google.de/"
myUsername="[ur name]"
token = spotipy.prompt_for_user_token(myUsername,scope, myClientId, mySecret, myRedirect)
sp = spotipy.Spotify(auth_manager=token)
sp.current_user()
< /code>
Hier ist der vollständige Fehler in der Konsole: < /p>
File "C:\Users\a\Downloads\spotify2.py", line 18, in
sp.current_user()
File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 1173, in current_user
return self.me()
File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 1167, in me
return self._get("me/")
File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 297, in _get
return self._internal_call("GET", url, payload, kwargs)
File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 221, in _internal_call
headers = self._auth_headers()
File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 212, in _auth_headers
token = self.auth_manager.get_access_token(as_dict=False)
AttributeError: 'str' object has no attribute 'get_access_token'
Ich versuche, einen Musikbot mit Python für Spotify zu erstellen, aber nichts funktioniert. < /p> Hier ist mein Code: < /p> [code]scope = 'user-read-private' myClientId = "[ur id]" mySecret = "[ur secret]" myRedirect="http://google.de/" myUsername="[ur name]"
sp = spotipy.Spotify(auth_manager=token) sp.current_user() < /code> Hier ist der vollständige Fehler in der Konsole: < /p> File "C:\Users\a\Downloads\spotify2.py", line 18, in sp.current_user() File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 1173, in current_user return self.me() File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 1167, in me return self._get("me/") File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 297, in _get return self._internal_call("GET", url, payload, kwargs) File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 221, in _internal_call headers = self._auth_headers() File "C:\Users\a\AppData\Local\Programs\Python\Python39\lib\site-packages\spotipy\client.py", line 212, in _auth_headers token = self.auth_manager.get_access_token(as_dict=False) AttributeError: 'str' object has no attribute 'get_access_token' [/code]
Ich habe einen Fehler aufgetreten, während ich mit der Langchain_Core Langchain-Openai Bibliothek gearbeitet habe, und ich hoffe, dass mir jemand bei der Lösung dieses Problems unterstützen kann....