[GH-ISSUE #769] TypeError: __init__() got an unexpected keyword argument 'allowed_methods' #470

Open
opened 2026-02-27 23:22:49 +03:00 by kerem · 1 comment
Owner

Originally created by @SeyiAgboola on GitHub (Jan 12, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/769

Describe the bug
I receive a TypeError when running the Spotify Credentials:

sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id=client_id,
client_secret=client_secret))

Your code
import spotipy
from spotipy.oauth2 import SpotifyClientCredentials

client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

Expected behavior
No error.

Output

TypeError Traceback (most recent call last)
in ()
9
10 sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id=client_id,
---> 11 client_secret=client_secret))
12
13 #Choose your artist via input

1 frames
/usr/local/lib/python3.7/dist-packages/spotipy/client.py in init(self, auth, requests_session, client_credentials_manager, oauth_manager, auth_manager, proxies, requests_timeout, status_forcelist, retries, status_retries, backoff_factor, language)
164 else:
165 if requests_session: # Build a new session.
--> 166 self._build_session()
167 else: # Use the Requests API module as a "session".
168 self._session = requests.api

/usr/local/lib/python3.7/dist-packages/spotipy/client.py in _build_session(self)
198 status=self.status_retries,
199 backoff_factor=self.backoff_factor,
--> 200 status_forcelist=self.status_forcelist)
201
202 adapter = requests.adapters.HTTPAdapter(max_retries=retry)

TypeError: init() got an unexpected keyword argument 'allowed_methods'

Environment:

  • OS: Windows
  • Python version: 3.7
  • spotipy version: latest
  • your IDE: Google Colab

Additional context
It was working fine last week

Originally created by @SeyiAgboola on GitHub (Jan 12, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/769 **Describe the bug** I receive a TypeError when running the Spotify Credentials: sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)) **Your code** import spotipy from spotipy.oauth2 import SpotifyClientCredentials client_credentials_manager = SpotifyClientCredentials(client_id=client_id, client_secret=client_secret) sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) **Expected behavior** No error. **Output** --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-14-568d31450f7f> in <module>() 9 10 sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id=client_id, ---> 11 client_secret=client_secret)) 12 13 #Choose your artist via input 1 frames /usr/local/lib/python3.7/dist-packages/spotipy/client.py in __init__(self, auth, requests_session, client_credentials_manager, oauth_manager, auth_manager, proxies, requests_timeout, status_forcelist, retries, status_retries, backoff_factor, language) 164 else: 165 if requests_session: # Build a new session. --> 166 self._build_session() 167 else: # Use the Requests API module as a "session". 168 self._session = requests.api /usr/local/lib/python3.7/dist-packages/spotipy/client.py in _build_session(self) 198 status=self.status_retries, 199 backoff_factor=self.backoff_factor, --> 200 status_forcelist=self.status_forcelist) 201 202 adapter = requests.adapters.HTTPAdapter(max_retries=retry) **TypeError: __init__() got an unexpected keyword argument 'allowed_methods'** **Environment:** - OS: Windows - Python version: 3.7 - spotipy version: latest - your IDE: Google Colab **Additional context** It was working fine last week
Author
Owner

@djlindsay87 commented on GitHub (Apr 17, 2022):

I'm having this error too and it was working fine two days ago. Have you resolved this yet? It's really being a buzzkill.

<!-- gh-comment-id:1100935283 --> @djlindsay87 commented on GitHub (Apr 17, 2022): I'm having this error too and it was working fine two days ago. Have you resolved this yet? It's really being a buzzkill.
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#470
No description provided.