我正在尝试部署一个在 python (python-gst) 中运行 gstreamer 绑定的程序。我为此使用 pyinstaller。我正在运行 Windows 7,python-2.7 64 位。这是一个最小的工作示例 - pyinstallertest.py:
import gi
print 'hello world'
然后我运行pyinstaller foo.spec
没有任何错误或警告,其中 foo.spec 是以下文件:
import os
gst_plugin_path = os.environ.get('GST_PLUGIN_PATH').split('lib')[0]
a = Analysis(['.\\pyinstallertest.py'],
pathex=['C:\\pyinstaller_test'],
hiddenimports=[],
hookspath=None,
runtime_hooks=None)
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='pytest.exe',
debug=False,
strip=None,
upx=True,
console=True )
coll = COLLECT(exe, Tree('./'),
Tree(gst_plugin_path),
Tree(os.path.join(gst_plugin_path, 'bin')),
a.binaries,
a.zipfiles,
a.datas,
strip=None,
upx=True,
name='pytest')
在 \dist\pytest\ 中运行生成的 pytest.exe 时,它会失败并出现以下错误:
File "C:\python27\lib\site-packages\pyinstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_importers.py", line 412, in load_module
module = imp.load_module(fullname, fp, filename, self._c_ext_tuple)
ImportError: DLL load failed: The specified procedure could not be found.
关于如何解决这个问题的任何想法,或者在包含 gstreamer(和 gi 包)的 Windows 中部署 python 程序的替代方法?