[英]Gst.init fails under anaconda, but works with native python
Gst的初始化工作是在ubuntu安裝的python下進行的,而不是通過anaconda安裝的python進行的:
我寫了一個小腳本來說明會發生什么:
$ cat gstinit.py
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
Gst.init(None)
print("Done!")
這是使用ubuntu python的結果:
$ /usr/bin/python2.7 gstinit.py
Done!
但是簡單地使用python
安裝的蟒蛇會給出:
$ 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)
搜索失敗的庫成功:
$ 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
這不是我第一次遇到gstreamer和anaconda問題。 這次,它遵循conda update
。 以下是anaconda下gstreamer的已安裝軟件包:
$ conda list | grep gst
gst-plugins-base 1.8.0 0 conda-forge
gstreamer 1.8.0 1 conda-forge
我的解決方案是:
在使用以下任何其他軟件包之前安裝PyGObject:
conda install -c pkgw pygobject3=3.18.2
這對我有用https://github.com/conda-forge/gstreamer-feedstock 。 它使用conda-forge。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.