我使用的是Ubuntu13.04,安装了python2.7和3.3.2。我最近开始使用python 3,但是当我试图导入"pygst“gstreamer模块时,我得到了一个错误:
ImportError:没有名为“pygst”的模块
在python2.x中,一切都很好
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygst
>>> exit()
Python 3.3.2 (default, Oct 6 2013, 01:42:16)
[GCC 4.7.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygst
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'pygst'如何在python 3中导入这个模块?
提前谢谢你!
发布于 2013-10-07 11:51:07
如果您有ubuntu13.04,为什么不通过内省使用GStreamer1.0,您可以使用:
from gi.repository import Gst发布于 2013-10-06 23:47:43
库必须专门编写,以便同时使用Python2和Python3,因为它们有一点不同。
我在gstreamer的主页上找不到对Python3的任何引用,所以我猜他们不支持它。您要么自己将它移植到Python3,要么坚持使用Python2 (或者没有它)。
https://stackoverflow.com/questions/19214528
复制相似问题