我正在尝试使用gst-build在windows上构建GStreamer。我的环境:
错误信息是:
>ninja -C build
ninja: Entering directory `build'
[1/30] Generating gir-glib with a custom command (wrapped by meson to set PATH)
FAILED: subprojects/gobject-introspection/gir/GLib-2.0.gir
[long list of python subprocess args with include patsh, c files etc]
Traceback (most recent call last):
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\tools\g-ir-scanner", line 98, in <module>
from giscanner.scannermain import scanner_main
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\scannermain.py", line 35, in <module>
from giscanner.ast import Include, Namespace
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\ast.py", line 29, in <module>
from .sourcescanner import CTYPE_TYPEDEF, CSYMBOL_TYPE_TYPEDEF
File "C:\Work\GStreamer-build\source\gst-build\build\subprojects\gobject-introspection\giscanner\sourcescanner.py", line 35, in <module>
from giscanner._giscanner import SourceScanner as CSourceScanner
ImportError: DLL load failed while importing _giscanner: The specified module could not be found.
ninja: build stopped: subcommand failed.如果我检查构建目录:

因此,该文件确实构建,但由于某种原因无法导入。
我从这里中看到,在查找DLL的方式上对python3.8有一些更改,但是即使我在父目录中手动打开python提示符并将父目录和giscanner目录添加到sys.path中,使用os.add_dll_directory,我仍然无法导入模块:
>>> import os,sys
>>> a = os.add_dll_directory(os.getcwd())
>>> a
<AddedDllDirectory('C:\\Work\\GStreamer-build\\source\\gst-build\\build\\subprojects\\gobject-introspection')>
>>> b = os.add_dll_directory(os.path.join(os.getcwd(),'giscanner'))
>>> b
<AddedDllDirectory('C:\\Work\\GStreamer-build\\source\\gst-build\\build\\subprojects\\gobject-introspection\\giscanner')>
>>> sys.path.insert(0, os.getcwd())
>>> sys.path.insert(0, os.path.join(os.getcwd(),'giscanner'))进一步的挖掘表明,pkg-config似乎不知道在哪里找到gio,但是它也是作为构建的一部分成功地构建的,所以不知道为什么它不知道。
发布于 2021-11-03 11:27:48
不确定实际问题,但解决方法是将Python还原为3.7.9 (64位)
https://www.python.org/downloads/release/python-379
还建议您可以不使用该组件进行构建。
-Dintrospection=disabled
https://stackoverflow.com/questions/68127449
复制相似问题