[GH-ISSUE #755] AttributeError: module 'spotipy.util' has no attribute 'oauth2' during authentication flow #459

Closed
opened 2026-02-27 23:22:44 +03:00 by kerem · 2 comments
Owner

Originally created by @Sachabanksy on GitHub (Dec 12, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/755

Hi there,
I am trying to run some code that will return playlist data however get the error:

AttributeError: module 'spotipy.util' has no attribute 'oauth2'

This occurs after attempting to run:

token = util.oauth2.SpotifyClientCredentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET)
cache_token = token.get_access_token()
sp = spotipy.Spotify(cache_token)

Very new to this, any help would be greatly appreciated, cheers.

Originally created by @Sachabanksy on GitHub (Dec 12, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/755 Hi there, I am trying to run some code that will return playlist data however get the error: AttributeError: module 'spotipy.util' has no attribute 'oauth2' This occurs after attempting to run: token = util.oauth2.SpotifyClientCredentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET) cache_token = token.get_access_token() sp = spotipy.Spotify(cache_token) Very new to this, any help would be greatly appreciated, cheers.
kerem 2026-02-27 23:22:44 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@stephanebruckert commented on GitHub (Dec 12, 2021):

I'm not sure where you got this code from but it is wrong as spotipy.util clearly has no attribute oauth2

Please check the README, examples, and documentation for hints on how to get started.

<!-- gh-comment-id:991888602 --> @stephanebruckert commented on GitHub (Dec 12, 2021): I'm not sure where you got this code from but it is wrong as `spotipy.util` clearly has no attribute `oauth2` Please check the README, examples, and documentation for hints on how to get started.
Author
Owner

@dieser-niko commented on GitHub (May 1, 2024):

Closing as there's no activity.

<!-- gh-comment-id:2089100725 --> @dieser-niko commented on GitHub (May 1, 2024): Closing as there's no activity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#459
No description provided.