YvesG
YvesG

Reputation: 11

Gst.init fails under anaconda, but works with native python

Initialisation of Gst works under python as installed by ubuntu, not with python installed by anaconda:

I wrote a small script to show what happens:

$ cat gstinit.py 
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
Gst.init(None)
print("Done!")

Here is the result using ubuntu python:

$ /usr/bin/python2.7 gstinit.py 
Done!

But simply using python as installed by anaconda gives:

$ python gstinit.py 

** (process:27029): WARNING **: Failed to load shared library 'libgstreamer-1.0.so.0' referenced by the typelib: libiconv.so.2: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "gstinit.py", line 4, in <module>
    Gst.init(None)
gi._error.GError: g-invoke-error-quark: Could not locate gst_init: libiconv.so.2: cannot open shared object file: No such file or directory (1)

A search for the failed library succeeds:

$ ls -lt $(find /usr -name libgstreamer-1.0.so.0)
lrwxrwxrwx 1 root root 27 sept.  6 15:16 /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 -> libgstreamer-1.0.so.0.803.0
lrwxrwxrwx 1 root root 27 sept.  6 15:12 /usr/lib/i386-linux-gnu/libgstreamer-1.0.so.0 -> libgstreamer-1.0.so.0.803.0

This is not the first time I get problems with gstreamer and anaconda. This time, it follows a conda update. Here are the installed packages for gstreamer under anaconda:

$ conda list | grep gst
gst-plugins-base          1.8.0                         0    conda-forge
gstreamer                 1.8.0                         1    conda-forge

Upvotes: 0

Views: 1625

Answers (2)

Gooshan
Gooshan

Reputation: 2490

This worked for me https://github.com/conda-forge/gstreamer-feedstock. It uses conda-forge.

Upvotes: 0

YvesG
YvesG

Reputation: 11

My solution was:

  • remove anaconda,
  • reinstall it (not the newest version 4.2.0, but version 4.1.0),
  • install PyGObject before any other package with:

    conda install -c pkgw pygobject3=3.18.2
    

Upvotes: 1

Related Questions