hi,
when trying to run the executable built by pfreeze tool, i got the following error:
Traceback (most recent call last):
File "game.py", line 4, in <module>
from functions import *
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 983, in _find_and_load
return _find_and_load_unlocked(name, import_)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
module = _load_unlocked(spec)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 677, in _load_unlocked
spec.loader.exec_module(module)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 819, in exec_module
exec(code, module.__dict__)
File "E:\projects\python\the life of crime\functions.py", line 5, in <module>
from win32api import *
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 983, in _find_and_load
return _find_and_load_unlocked(name, import_)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 967, in _find_and_load_unlocked
module = _load_unlocked(spec)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 670, in _load_unlocked
module = module_from_spec(spec)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 583, in module_from_spec
module = spec.loader.create_module(spec)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap_external.py", line 1043, in create_module
_imp.create_dynamic, spec)
File "E:\projects\python\examplegame\lib\importlib\_bootstrap.py", line 219, in _call_with_frames_removed
return f(*args, **kwds)
ImportError: DLL load failed: The specified module could not be found.
of course it works with the default python interpreter.
this is the build log:
running build_apps
Building platforms: win32,win_amd64
Gathering wheels for platform: win32
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt
Collecting panda3d (from -r E:\projects\python\examplegame\requirements.txt (line 1))
File was already downloaded e:\projects\python\examplegame\build\__whl_cache__\panda3d-1.10.2-cp37-cp37m-win32.whl
Successfully downloaded panda3d
Could not find an optimized wheel (using index https://archive.panda3d.org/simple/opt) for platform: win32
Building runtime for platform: win32
warning: build_apps: could not find dependency VERSION.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by deploy-stub.exe)
warning: build_apps: could not find dependency SETUPAPI.dll (referenced by libpanda.dll)
warning: build_apps: could not find dependency d3dx9_29.dll (referenced by libpandadx9.dll)
warning: build_apps: could not find dependency CRYPT32.dll (referenced by avformat-55.dll)
warning: build_apps: could not find dependency pywintypes37.dll (referenced by win32event.pyd)
warning: build_apps: could not find dependency VERSION.dll (referenced by win32api.pyd)
warning: build_apps: could not find dependency CRYPT32.dll (referenced by _ssl.pyd)
warning: build_apps: could not find dependency UxTheme.dll (referenced by mfc140u.dll)
warning: build_apps: could not find dependency WINSPOOL.DRV (referenced by win32ui.pyd)
There are some missing modules: ['__builtin__', '_posixsubprocess', 'appscript', 'dummy.Process', 'espeak.core', 'exceptions', 'grp', 'libloader.load_library', 'multiprocessing.AuthenticationError', 'multiprocessing.BufferTooShort', 'multiprocessing.TimeoutError', 'multiprocessing.get_context', 'multiprocessing.get_start_method', 'multiprocessing.set_start_method', 'sets', 'sitecustomize', 'win32com.gen_py']
Copying game files for platform: win32
Gathering wheels for platform: win_amd64
Looking in indexes: https://pypi.org/simple, https://archive.panda3d.org/simple/opt
Collecting panda3d (from -r E:\projects\python\examplegame\requirements.txt (line 1))
File was already downloaded e:\projects\python\examplegame\build\__whl_cache__\panda3d-1.10.2-cp37-cp37m-win_amd64.whl
Successfully downloaded panda3d
Could not find an optimized wheel (using index https://archive.panda3d.org/simple/opt) for platform: win_amd64
Building runtime for platform: win_amd64
warning: build_apps: could not find dependency VERSION.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by python37.dll)
warning: build_apps: could not find dependency VCRUNTIME140.dll (referenced by deploy-stub.exe)
warning: build_apps: could not find dependency SETUPAPI.dll (referenced by libpanda.dll)
warning: build_apps: could not find dependency d3dx9_43.dll (referenced by libpandadx9.dll)
warning: build_apps: could not find dependency CRYPT32.dll (referenced by avformat-55.dll)
warning: build_apps: could not find dependency CRYPT32.dll (referenced by _ssl.pyd)
warning: build_apps: could not find dependency VERSION.dll (referenced by win32api.pyd)
warning: build_apps: could not find dependency UxTheme.dll (referenced by mfc140u.dll)
warning: build_apps: could not find dependency WINSPOOL.DRV (referenced by win32ui.pyd)
Copying game files for platform: win_amd64
i think the issue is with pywintypes.dll and pythoncom.dll, since pywin32 uses them as far as i know.
and, of course here is my setup script:
from setuptools import *
opts = {
"build_apps":{
"console_apps":{
"game":"game.py"
},
"platforms":["win32", "win_amd64"],
"include_patterns":["sounds.dat"],
"plugins":["pandadx9", "pandagl", "p3openal_audio", "p3ffmpeg"]
}
}
setup(name="game", options=opts)
thanks.