簡體   English   中英

Gst.init在anaconda下失敗,但可用於本機python

[英]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

我的解決方案是:

  • 刪除水蟒,
  • 重新安裝它(不是最新的版本4.2.0,而是版本4.1.0),
  • 在使用以下任何其他軟件包之前安裝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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM