4

I'm using Ubuntu 13.04 and have python 2.7 and 3.3.2 installed. I have recently started using python 3, but when I trying to import "pygst" gstreamer module, I get an error:

ImportError: No module named 'pygst'

In python 2.x everything works fine

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'

How can I get this module to import in python 3?

Thank you in advance!

boxeus
  • 384
  • 2
  • 6
  • 13

2 Answers2

2

If you have ubuntu 13.04, why don't you use gstreamer 1.0 through introspection, you can import with :

from gi.repository import Gst
Mathieu_Du
  • 787
  • 4
  • 10
  • Thanks, but I can't import "gi" too, it gives me the same error: `>>> import gi Traceback (most recent call last): File "", line 1, in ImportError: No module named 'gi'` Package "python3-gi" installed, and gi files is in "/usr/lib/python3/dist-packages/" directory – boxeus Oct 07 '13 at 17:19
  • 2
    if "which python" shows you a symbolic link to python2 then the problem is here :) – Mathieu_Du Oct 07 '13 at 20:38
1

Libraries must be specifically written to work with both Python2 and Python3 as they are a bit different.

I was unable to find any reference to Python3 at gstreamer's home page, so my guess is they don't support it. You'll either have to port it yourself to Python3, or stick with Python2 (or live without it).

Ethan Furman
  • 63,992
  • 20
  • 159
  • 237