I am new to hubspot and this is my first posting. I am having an issue when compiling my program using PyInstaller. I am unable to run the .exe created by PyInstaller; I get the following error:
C:\Projects>HubSpot_GET_Companies.exe
Traceback (most recent call last):
File "HubSpot_GET_Companies.py", line 7, in <module>
File "hubspot\discovery\crm\companies\discovery.py", line 24, in get_all
File "hubspot\discovery\crm\companies\discovery.py", line 9, in basic_api
File "hubspot\discovery\discovery_base.py", line 20, in _configure_api_client
File "pkg_resources\__init__.py", line 899, in require
File "pkg_resources\__init__.py", line 785, in resolve
pkg_resources.DistributionNotFound: The 'hubspot-api-client' distribution was not found and is required by the application
[10632] Failed to execute script HubSpot_GET_Companies
I have attempted to use the --hidden-import parameter of PyInstaller with several different variations of what I think is the correct module name (tried "hubspot", "HubSpot", "hubspot-api-client", but when PyInstaller compiles, it does not include any library data for hubspot modules. Therefore my application will not run on my local or remote machine.
In the header of my script, I have imported hubspot:
from hubspot import HubSpot
import pandas as pd
import os
Any idea what am I doing wrong? I feel like it is something simple, but I have been struggling with this all day, and I can't seem to find anything online about how to solve this.
Hi Taran, thanks for the reply. Yeah ... could be the module, I tried installing and uninstalling via pip. Same result. I was unable to figure this out, but decided just to use the compiled .pyc files (which run as expected from the __pycached__ folder) instead of spending any more time on trying to compile .exes.
Jun 30, 202110:25 AM - edited Jun 30, 202110:25 AM
Contributor
hubspot-api-client Distribution
SOLVE
@dennisedson I am not familiar with PyInstaller, so I am only able to speculate as to what could be wrong here.
@GBeckwith I would say to make sure you're including the correct HubSpot module; I think there are a few of them floating around. It may also depend on if you're using v2 or v3.
Hi Taran, thanks for the reply. Yeah ... could be the module, I tried installing and uninstalling via pip. Same result. I was unable to figure this out, but decided just to use the compiled .pyc files (which run as expected from the __pycached__ folder) instead of spending any more time on trying to compile .exes.