square-python-sdk icon indicating copy to clipboard operation
square-python-sdk copied to clipboard

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

Open babishdesai opened this issue 4 years ago • 7 comments

i keep getting below error on raspberry pi with python 2.7.16

Traceback (most recent call last): File "orders.py", line 10, in environment='sandbox', File "/home/pi/orders/square/client.py", line 203, in init additional_headers=additional_headers) File "/home/pi/orders/square/configuration.py", line 96, in init self._http_client = self.create_http_client() File "/home/pi/orders/square/configuration.py", line 127, in create_http_client retry_methods=self.retry_methods) File "/home/pi/orders/square/http/requests_client.py", line 40, in init status_forcelist=retry_statuses, allowed_methods=retry_methods) TypeError: init() got an unexpected keyword argument 'allowed_methods'

babishdesai avatar Aug 11 '21 21:08 babishdesai

I'm started getting this error too, on Mac OS with Python 3.8.

bobby-alter avatar Aug 23 '21 23:08 bobby-alter

Me too

kwamena98 avatar Sep 08 '21 21:09 kwamena98

Can you guys help out

kwamena98 avatar Sep 08 '21 21:09 kwamena98

I'm started getting this error too, on Mac OS with Python 3.8.

Did you get the solution?

kwamena98 avatar Sep 08 '21 21:09 kwamena98

you can solve this issue by upgrading urllib3 to 1.26.x

isaac-rego avatar Sep 17 '21 17:09 isaac-rego

This has to be handled better than this....When SDK version is upgraded, either dependencies need to be upgraded or at least appropriate information need to be mentioned in RELEASE NOTES

senthilmk avatar Oct 11 '21 16:10 senthilmk

why don't you guys use Curl in python

kwamena98 avatar Oct 11 '21 16:10 kwamena98

Was this issue solved.Am getting this error as well

  File "<console>", line 2, in <module>
  File "/usr/local/lib/python3.7/site-packages/square/client.py", line 248, in __init__
    user_agent_detail=user_agent_detail)
  File "/usr/local/lib/python3.7/site-packages/square/configuration.py", line 68, in __init__
    super().set_http_client(self.create_http_client())
  File "/usr/local/lib/python3.7/site-packages/square/configuration.py", line 109, in create_http_client
    response_factory=super().http_response_factory
  File "/usr/local/lib/python3.7/site-packages/apimatic_requests_client_adapter/requests_client.py", line 42, in __init__
    retry_methods, verify)
  File "/usr/local/lib/python3.7/site-packages/apimatic_requests_client_adapter/requests_client.py", line 70, in create_default_http_client
    status_forcelist=retry_statuses, allowed_methods=retry_methods)
TypeError: __init__() got an unexpected keyword argument 'allowed_methods'

Murithijoshua avatar Apr 02 '23 04:04 Murithijoshua

Hi @Murithijoshua

What version of the SDK are you using? Can you share the code you are using to invoke the SDK that is causing this error?

We also suggest posting questions to our Developer Forums as it is more widely monitored, and has active activity from Square Employees and developers in the Community.

Cheers!

zenmasterjobo avatar Apr 03 '23 16:04 zenmasterjobo

@zenmasterjobo I found the solution, I just used python requests instead.Thanks

Murithijoshua avatar May 31 '23 09:05 Murithijoshua

Closing this issue, but if anyone runs into this problem again, please feel free to re-open!

Thanks :)

zenmasterjobo avatar Aug 07 '23 15:08 zenmasterjobo