AttributeError: module 'hubspot' has no attribute 'Client'

I have the following code…

client = hubspot.Client.create(access_token="pat-na1-.......-d8f7356736")

properties = {"amount": "100", "hs_product_id": "160978607", "quantity": "1234"}

simple_public_object_input = SimplePublicObjectInput(properties=properties)
try:
 api_response = client.crm.line_items.basic_api.create(simple_public_object_input=simple_public_object_input)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling basic_api->create: %s\n" % e)

and get the following error…

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Input In [33], in <cell line: 1>()
----> 1 client = hubspot.Client.create(access_token="pat-na.....")
 3 properties = {"amount": "100", "hs_product_id": "16099....07", "quantity": "1234"}
 5 simple_public_object_input = SimplePublicObjectInput(properties=properties)

AttributeError: module 'hubspot' has no attribute 'Client'

Note: I cut out the access_token when I pasted it here.

Im unsure how to fix the attribute error…

Is that all your code? I’m unfamilair with the Python library, but your code doens’t look like the code here: GitHub - HubSpot/hubspot-api-python: HubSpot API Python Client Libraries for V3 version of the API · GitHub

The library example seems to instantiate from the HubSpot object. You are doing something different. Sorry I can’t help, but just seems like you are trying to do things differently, and the docs don’t reference a Client either.

client = HubSpot(access_token='your_access_token')