Hi Ali,
Yes, for a desktop Win32 app using Windows.Services.Store, Microsoft requires the StoreContext object to be associated with your app’s window before calling methods that display Store UI. This is done through IInitializeWithWindow and the HWND of your main window. If that association is missing, RequestPurchaseAsync can fail with an invalid window handle error or the purchase UI may not appear.
Also make sure RequestPurchaseAsync is called on the UI thread and that the application is not running elevated, because Microsoft Store in-app purchasing is not supported for elevated applications.
For debugging, inspect the StorePurchaseResult returned from RequestPurchaseAsync, including its Status and ExtendedError properties, and also check the StoreProductQueryResult errors when retrieving the add-on. I would first confirm that your Python WinRT wrapper exposes the COM interface needed for IInitializeWithWindow and that PyInstaller is not changing the window/process context.
Thank you, and feel free to respond back for more assistance.