我试图使用GstPbutils python3模块,但只是导入它会破坏一切,这里是代码:
#!/usr/bin/python3
import gi
gi.require_version('GstPbutils', '1.0')
from gi.repository import GstPbutils
print('Hello World!')
输出:
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_array_append_vals: assertion 'array' failed
g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_hash_table_lookup: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()
/usr/lib/python3/dist-packages/gi/module.py:178: Warning: g_hash_table_insert_internal: assertion 'hash_table != NULL' failed
g_type = info.get_g_type()
Hello World!
我的发行版是否破损?我做错了吗?
答案 0 :(得分:0)
这些只是警告,一切都应该正常,无论如何你可以使用以下代码删除它们:
import sys
sys.modules["gi.overrides.Gst"] = None
sys.modules["gi.overrides.GstPbutils"] = None