简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM