iamkubi / pydactyl

Python wrapper for the Pterodactyl Panel API
MIT License
67 stars 21 forks source link

TypeError: Retry.__init__() got an unexpected keyword argument 'allowed_methods' #80

Open DimitrovC opened 10 months ago

DimitrovC commented 10 months ago

Describe the bug Pydactyl / Requests don't work on ubuntu 22.04 using python 3.11

To Reproduce Code: client = PterodactylClient(API_Link, API_Code)

Error: Traceback (most recent call last): File "/var/www/discordbot/app.py", line 37, in client = PterodactylClient(API_Link, API_Code)

File "/usr/local/lib/python3.11/dist-packages/pydactyl/api_client.py", line 69, in init adapter = http_adapter(backoff_factor=backoff_factor, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/pydactyl/api_client.py", line 16, in http_adapter retries = requests.adapters.Retry( ^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Retry.init() got an unexpected keyword argument 'allowed_methods'

Expected behavior When i tried to run the code on my linux vps i expected to work perfectly because it worked on my windows pc normally.

Environment

iamkubi commented 10 months ago

You need to update your requests library. The version in dev-requirements.txt should work, although I suppose I should add a requirements.txt that includes the correct requests version.

DimitrovC commented 10 months ago

You need to update your requests library. The version in dev-requirements.txt should work, although I suppose I should add a requirements.txt that includes the correct requests version.

Actually i have updated the requests library to the latest version and still getting this error

iamkubi commented 10 months ago

Technically it's the urllib3 version that requests depends on. The method_whitelist parameter was was deprecated and removed from urllib3 1.26.0 onwards, as stated in the release changelog.

If you install the "latest" requests version it will install a version of urllib3 that uses allowed_methods instead of method_whitelist.

DimitrovC commented 10 months ago

Technically it's the urllib3 version that requests depends on. The method_whitelist parameter was was deprecated and removed from urllib3 1.26.0 onwards, as stated in the release changelog.

If you install the "latest" requests version it will install a version of urllib3 that uses allowed_methods instead of method_whitelist.

Its working, thanks.