Hi There,
Using Python 3.8.10 on Ubuntu, and running into a peculiar problem for a simple code:
from square.client import Client
import os
client = Client(
access_token=os.environ['SQUARE_ACCESS_TOKEN'],
environment='sandbox')
result = client.locations.list_locations()
if result.is_success():
for location in result.body['locations']:
print(f"{location['id']}: ", end="")
print(f"{location['name']}, ", end="")
print(f"{location['address']['address_line_1']}, ", end="")
print(f"{location['address']['locality']}")
elif result.is_error():
for error in result.errors:
print(error['category'])
print(error['code'])
print(error['detail'])
Error:
python3 test.py Traceback (most recent call last):
File βtest.pyβ, line 4, in
client = Client(
File β/usr/local/lib/python3.8/dist-packages/square/client.pyβ, line 234, in init
self.config = Configuration(
File β/usr/local/lib/python3.8/dist-packages/square/configuration.pyβ, line 68, in init
super().set_http_client(self.create_http_client())
File β/usr/local/lib/python3.8/dist-packages/square/configuration.pyβ, line 103, in create_http_client
return RequestsClient(
File β/usr/local/lib/python3.8/dist-packages/apimatic_requests_client_adapter/requests_client.pyβ, line 40, in init
self.create_default_http_client(timeout, cache, max_retries,
File β/usr/local/lib/python3.8/dist-packages/apimatic_requests_client_adapter/requests_client.pyβ, line 69, in create_default_http_client
retries = Retry(total=max_retries, backoff_factor=backoff_factor,
TypeError: init() got an unexpected keyword argument βallowed_methodsβ
Any suggestions as to why such error is occurring? Its occurring at the client connection phase.