Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - No module named pygst

I'm using virtualenv on Ubuntu 14.04 with Python 2.7.13, and I'm trying to get import pygst to work (I'm a complete Python noob).

I downloaded:
https://gstreamer.freedesktop.org/src/gst-python/gst-python-1.12.1.tar.xz

Compiled and installed with:
./configure --prefix=$VIRTUAL_ENV && make install

However I still cannot import pygst:

>>> import pygst
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygst

There's also no pip package that matches pygst. I must be missing something really simple, but I can't figure it out.

This does not help either, because it only affects the system Python installation, not virtualenv:

sudo apt-get install python-gst0.10 gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly

How do I install pygst with virtualenv?

like image 532
Casper Avatar asked Oct 29 '22 05:10

Casper


1 Answers

You need to install the pygst module

sudo apt-get install python-gst0.10 gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly

Then if you want access it in you virtualenv you can make a symlink to your site-packages, just replace 'venv' with the foldername of your virtualenv.

cd venv/lib/python2.7/site-packages
ln -s /usr/lib/python2.7/dist-packages/glib
ln -s /usr/lib/python2.7/dist-packages/gobject
ln -s /usr/lib/python2.7/dist-packages/gst-0.10
ln -s /usr/lib/python2.7/dist-packages/gstoption.so
ln -s /usr/lib/python2.7/dist-packages/gtk-2.0
ln -s /usr/lib/python2.7/dist-packages/pygst.pth
ln -s /usr/lib/python2.7/dist-packages/pygst.py
ln -s /usr/lib/python2.7/dist-packages/pygtk.pth
ln -s /usr/lib/python2.7/dist-packages/pygtk.py
like image 191
Logovsky Dmitry Avatar answered Oct 31 '22 19:10

Logovsky Dmitry