I'm compiling an exe for a program that uses a specific submodule of winrt. The program works when running it normally and it compiles successfully, but when I run the .exe, the process hangs for about 15 seconds, then spits out this error:
Traceback (most recent call last):
File "app.py", line 11, in <module>
from winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
File "zipextimporter.pyc", line 97, in load_module
File "<frozen zipimport>", line 259, in load_module
File "winrt\windows\media\__init__.pyc", line 101, in <module>
AttributeError: 'NoneType' object has no attribute 'MediaTimeRange'
The Winrt package is included in the build, as confirmed by the traceback and also by checking in library.zip. Not entirely sure what's happening.
Code
import asyncio
import json
import os
import threading
import signal
import sys
import time
from pypresence import Presence
import re
from winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager`
Setup.py
from distutils.core import setup
import py2exe
setup(
console=["app.py"],
options={"py2exe": {
"bundle_files": 1, "compressed": True, "optimize": 2,
}},
version="1.0.0"
)
I'm compiling an exe for a program that uses a specific submodule of winrt. The program works when running it normally and it compiles successfully, but when I run the .exe, the process hangs for about 15 seconds, then spits out this error:
The Winrt package is included in the build, as confirmed by the traceback and also by checking in library.zip. Not entirely sure what's happening.
Code
from winrt.windows.media.control import GlobalSystemMediaTransportControlsSessionManager as MediaManager`
Setup.py