I recently made a script, which is a single function fill()
, runs in PyCharm with no problems
I used pyinstaller to convert to .exe: pyinstaller --onefile main.py
: Works great
I added the following function: around fill()
chargebee.configure(site='site-address', api_key='api_key')
subscription_key = "subscription_key"
def check_subscription(subscription_key):
subscription = chargebee.Subscription.retrieve(subscription_key)
if subscription.subscription.status == "active":
fill()
else:
print("Error is here1")
print("Subscription is either not active or is having an issue, please check to make sure your subscription is valid if you continue haveing issues")
return False
return False
if __name__ == '__main__':
print("Starting:")
check_subscription(subscription_key)
This runs perfectly in Pycharm but after pyinstaller converts it to .exe.
I run it and it returns: "OS Error: Could not find a suitable TLS CA certificate bundle invalid path C:\Users\username\AppData\Local\Temp_MEI70082\chargebee\ssl\ca-certs.crt"
This makes sense as There is no folder _MEI70082\
I have tried:
pyinstaller --onefile --add-data "venv\Lib\site- packages\chargebee\ssl\ca-certs.crt;chargebee\ssl main.py"
pyinstaller --onefile--paths "C:\Users\username\PycharmProjects\YP_Key_package_2\venv\Lib\site-packages\chargebee\ssl" main.py
But I am still getting the same error.
Any thoughts?