0

我正在尝试使用 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!

我的发行版被破坏了吗?我做错了吗?

4

1 回答 1

0

这些只是警告,一切都应该可以正常工作,无论如何您可以使用以下代码删除它们:

import sys
sys.modules["gi.overrides.Gst"] = None
sys.modules["gi.overrides.GstPbutils"] = None

来源:https ://bugzilla.gnome.org/show_bug.cgi?id=736260

于 2016-07-19T16:00:13.693 回答