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

**URL:** <https://community.hubspot.com/t/attributeerror-module-hubspot-has-no-attribute-client/65887>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [September 26, 2022, 4:25pm UTC](https://community.hubspot.com/t/attributeerror-module-hubspot-has-no-attribute-client/65887 "2022-09-26T16:25:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LWright1](https://avatars.discourse-cdn.com/v4/letter/l/e8c25b/32.png) [@LWright1](https://community.hubspot.com/u/LWright1)\
**Post date:** [September 26, 2022, 4:25pm UTC](https://community.hubspot.com/t/attributeerror-module-hubspot-has-no-attribute-client/65887/1 "2022-09-26T16:25:04Z")

</div>

I have the following code…

```lia-code-sample
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…

```auto
---------------------------------------------------------------------------
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…

---

<div class="post-metadata">

**Author:** ![LeeBartelme](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/leebartelme/32/95647_2.png) [@LeeBartelme](https://community.hubspot.com/u/LeeBartelme)\
**Post date:** [September 27, 2022, 1:20pm UTC](https://community.hubspot.com/t/attributeerror-module-hubspot-has-no-attribute-client/65887/2 "2022-09-27T13:20:10Z")

</div>

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](https://github.com/HubSpot/hubspot-api-python)

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')`
