mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #647] TypeError: __init__() got an unexpected keyword argument 'allowed_methods' #386
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#386
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marcswan on GitHub (Feb 28, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/647
Hi, i started to get this error after update. Month ago it worked perfectly fine. I am new to python so maybe i am doing something wrong.
And I get this response
When I changed it to this as in docs
sp = spotipy.Spotify(auth_manager=SpotifyClientCredentials(client_id = 'my_client_id', client_secret = 'my_client_secret'))i still have the same error.
@stephanebruckert commented on GitHub (Feb 28, 2021):
Hello. If you do
pip listorpip3 list, what version do you have forrequestsandurllib3? You should haveurllib3>=1.26andrequests>=2.25@marcswan commented on GitHub (Feb 28, 2021):
Oh, thank you. I've upgraded urllib3 and now it's working!
@stephanebruckert commented on GitHub (Feb 28, 2021):
It's strange though, it should have updated automatically when doing
pip3 install spotipy --upgradeLet's see if someone else complains about it
@PutuAgastya commented on GitHub (Feb 28, 2021):
Hello, I also encounter the same error message as mentioned above. Upgrading urllib3 fix the error.
Urllib3 was not updated automatically when I update this package. Here's the output when I updated Spotipy package.
@stephanebruckert commented on GitHub (Feb 28, 2021):
requests 2.25.0 wasn't forcing update of urllib3 to 1.26.0.
Should be fine now on spotipy 2.17.1
Thanks for reporting!
@surenjanath commented on GitHub (May 21, 2021):
oh i got a little tip on this error, if you're outside of the countries that spotify works eg [ US, France etc ], you'd get this error without a vpn, just use vpn and it'll work :)
@Peter-Schorn commented on GitHub (May 21, 2021):
This error was caused by using the wrong version of urllib3. How could it have anything to do with the country that you are in? The error occurs before any web API requests are even made.
@jenniferstefaniks commented on GitHub (Aug 22, 2021):
Good night people,
I have the same problem as @marcswan and even upgrading the pip and updating urllib3 and requests, it still gives me the same problem
'init() got an unexpected keyword argument 'allowed_methods'
Would there be another way to resolve this error?
@stephanebruckert commented on GitHub (Aug 22, 2021):
@jenniferstefaniks can you please answer the question above and we'll try to help
@jenniferstefaniks commented on GitHub (Aug 22, 2021):
Good night, they are in the current version. urllib3>=1.26.0
requests>=2.25.0 I'm using collab notebook
Em sáb., 21 de ago. de 2021 às 21:56, Stéphane Bruckert <
@.***> escreveu:
@OllySalanson commented on GitHub (Sep 3, 2021):
Hi,
I am receiving the same error message.
spotipy, requests and urllib3 are up to date:
spotipy 2.19.0
urllib3 1.26.6
requests 2.26.0
I'm using ubuntu EC2 AWS with Python 3.8.10.
Traceback (most recent call last): File "main.py", line 197, in <module> trackIds = populateTrackIds() File "main.py", line 57, in populateTrackIds sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="b95eb7c97a4f4bd5a13ab9da3aad447d", File "/usr/local/lib/python3.8/dist-packages/spotipy/client.py", line 166, in __init__ self._build_session() File "/usr/local/lib/python3.8/dist-packages/spotipy/client.py", line 193, in _build_session retry = urllib3.Retry( TypeError: __init__() got an unexpected keyword argument 'allowed_methods'@s2t2 commented on GitHub (Nov 24, 2021):
On colab:
Then restart the runtime for it to work.
@sebastienmaurette commented on GitHub (Dec 28, 2021):
hello !
Same thing for me.
All my versions have been upgraded
@stephanebruckert commented on GitHub (Dec 28, 2021):
@sebastienmaurette please share your versions of requests and urllib3
@hikariatama commented on GitHub (Mar 10, 2022):
requests==2.27.1urllib3==1.26.8spotipy==2.19.0pip3 install -U requests urllib3 spotipyhave not solved the issue, sadly@Selfie-bd commented on GitHub (Jun 13, 2022):
TypeError: Client.__init__() got an unexpected keyword argument 'session_name'When this code
QueueDB = {} ReplyDB = {} FormtDB = {} NubBot = Client( session_name=Config.SESSION_NAME, api_id=int(Config.API_ID), api_hash=Config.API_HASH, bot_token=Config.BOT_TOKEN )@Eeman1113 commented on GitHub (Jul 10, 2022):
@samerkhateeb commented on GitHub (Jan 24, 2025):
i removed the line of code "allowed_methods" attribute from the method,
and it worked like charm !!
/usr/local/lib/python3.9/site-packages/apimatic_requests_client_adapter/requests_client.py
retry_strategy = Retry(total=max_retries, backoff_factor=backoff_factor,
#allowed_methods=retry_methods,
status_forcelist=retry_statuses,raise_on_status=False, raise_on_redirect=False)
@dieser-niko commented on GitHub (Jan 24, 2025):
@samerkhateeb could you share the result of using
pip freeze?@samerkhateeb commented on GitHub (Jan 24, 2025):
@dieser-niko which packages you are looking for ? i'll give you the pip freeze of it.
@dieser-niko commented on GitHub (Jan 24, 2025):
I'm mostly interested in spotipy, requests and especially urllib3.
@samerkhateeb commented on GitHub (Jan 24, 2025):
@dieser-niko find the following:
requests==2.25.0
requests-file==1.5.1
requests-oauthlib==1.3.0
requests-toolbelt==0.9.1
rfc3986==1.5.0
rjsmin==1.1.0
rsa==4.7.2
selenium==3.141.0
service-identity==18.1.0
simplejson==3.17.2
six==1.15.0
sniffio==1.2.0
soupsieve==2.0.1
spotipy==2.25.0
sqlparse==0.3.1
starlette==0.13.6
streamlink==1.4.1
textblob==0.15.3
threadpoolctl==2.1.0
tomli==2.2.1
tqdm==4.61.0
twilio==6.51.0
Twisted==21.2.0
txaio==21.2.1
typing-extensions==3.7.4.3
typish==1.7.0
tzlocal==2.1
Unidecode==1.1.1
urllib3==1.26.1
uvicorn==0.13.4
virtualenv==20.28.0
vote==1.0.2
webencodings==0.5.1
websocket-client==0.57.0
wells==1.4.1
youtube-dl==2020.6.16.1
zeep==3.4.0
zope.interface==5.1.0
@dieser-niko commented on GitHub (Feb 7, 2025):
@samerkhateeb sorry, but I wasn't able to replicate your error, just too much going on there.
Just a quick question, do you need all these libraries for your project? If not, then please consider using virtual environments instead. Might fix the issue.