HubSpot / hubspot-api-python

HubSpot API Python Client Libraries for V3 version of the API
Apache License 2.0
327 stars 104 forks source link

Not working properly with Python 3.12.2 #303

Open scorpionjacky opened 5 months ago

scorpionjacky commented 5 months ago

Env: MacOS, Python 3.12.2

pip install --upgrade hubspot-api-client

Collecting hubspot-api-client Downloading hubspot_api_client-9.0.0-py3-none-any.whl.metadata (7.0 kB) Requirement already satisfied: urllib3>=1.15 in /Users/mikechen/.pyenv/versions/3.12.2/envs/aplosetl_dev/lib/python3.12/site-packages (from hubspot-api-client) (2.2.1) Requirement already satisfied: six>=1.10 in /Users/mikechen/.pyenv/versions/3.12.2/envs/aplosetl_dev/lib/python3.12/site-packages (from hubspot-api-client) (1.16.0) Requirement already satisfied: certifi in /Users/mikechen/.pyenv/versions/3.12.2/envs/aplosetl_dev/lib/python3.12/site-packages (from hubspot-api-client) (2024.2.2) Requirement already satisfied: python-dateutil in /Users/mikechen/.pyenv/versions/3.12.2/envs/aplosetl_dev/lib/python3.12/site-packages (from hubspot-api-client) (2.9.0.post0) Downloading hubspot_api_client-9.0.0-py3-none-any.whl (3.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 13.7 MB/s eta 0:00:00a 0:00:01 Installing collected packages: hubspot-api-client Successfully installed hubspot-api-client-9.0.0 Note: you may need to restart the kernel to use updated packages.

Python 3.12.2 (main, Mar 31 2024, 11:45:50) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin Type "help", "copyright", "credits" or "license" for more information.

from hubspot import HubSpot

api_client = HubSpot(access_token='xxxxxxxxxxxxxxxxxx')

dir(api_client) ['class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'getstate', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', 'access_token', 'api_key', 'auth', 'automation', 'cms', 'communication_preferences', 'config', 'conversations', 'create', 'crm', 'events', 'files', 'marketing', 'settings', 'webhooks']

dir(api_client.crm) Traceback (most recent call last): File "", line 1, in File "/Users/mikechen/.pyenv/versions/aplosetl_dev/lib/python3.12/site-packages/hubspot/client.py", line 62, in crm from .discovery.crm.discovery import Discovery as CrmDiscovery File "/Users/mikechen/.pyenv/versions/aplosetl_dev/lib/python3.12/site-packages/hubspot/discovery/crm/discovery.py", line 1, in from ..discovery_base import DiscoveryBase File "/Users/mikechen/.pyenv/versions/aplosetl_dev/lib/python3.12/site-packages/hubspot/discovery/discovery_base.py", line 1, in import pkg_resources ModuleNotFoundError: No module named 'pkg_resources'

Note:

dir(api_client.crm) worked fine under 3.11.8

ian-whitestone commented 5 months ago

Hit the same thing today! setuptools needs to be added as an explicit dependency to fix it.

Not to suggest that is the right long term fix, but that will solve the issue in the short term.

mike-optifino commented 4 months ago

Hi! I have the same issue. Is a any chance to include this fix in next release? Thanks in advance! @alzheltkovskiy-hubspot

alzheltkovskiy-hubspot commented 4 months ago

Hi everyone. We are going to fix it in new release. I will notify you when this happens.

mikicz commented 2 months ago

Hey, any updates on this?

alzheltkovskiy-hubspot commented 2 months ago

Hey @mikicz, still in progress.

jesusch commented 1 month ago

any update?

Zaffer commented 2 weeks ago

+1 please fix

alzheltkovskiy-hubspot commented 1 week ago

Hi all. We going to fix it during the week.

spenweb commented 1 week ago

Hit the same thing today! setuptools needs to be added as an explicit dependency to fix it.

Not to suggest that is the right long term fix, but that will solve the issue in the short term.

I can confirm that installing setuptools[core]==74.1.1 worked for me.