Replies: 2 comments 1 reply
-
The teslapy folder contains two json files, those probably need to be included using this procedure: https://pyinstaller.readthedocs.io/en/stable/spec-files.html#using-data-files-from-a-module |
Beta Was this translation helpful? Give feedback.
1 reply
-
You need to modify the spec file to include endpoints.json and option_codes.json as data files to the teslapy module. If you don't know the path to these files, then you can some Python code to the spec file and modify the Analysis line: from os.path import split, join
import teslapy
base_path = split(teslapy.__file__)[0]
a = Analysis(...
datas=[(join(base_path, 'endpoints.json'), 'teslapy'),
(join(base_path, 'option_codes.json'), 'teslapy')],
...
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a program that is working well in Python 3.10 using teslapy, but when I generate a one file exe, the program compiles without error, but at run time, the following code fails:
#initialise Tesla API
try:
with teslapy.Tesla(email=TeslaAccountEmail,timeout=TeslaAccountTimeout) as tesla:
tesla.fetch_token()
except Exception as e:
logger.error('Fatal Error initialising Tesla API - ' + str(e))
exception_logger.exception('Fatal Error initialising Tesla API ' + str(e))
sys.exit()
try:
vehicles = tesla.vehicle_list()
except Exception as e:
logger.error('Fatal Error in Tesla API getting vehicle list - ' + str(e))
exception_logger.exception('Fatal Error in Tesla API getting vehicle list - ' + str(e))
sys.exit()
When the vehicle_list() call is made, it raises an exception with
Unknown endpoint name VEHICLE_LIST
Can anyone advise how to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions