Я хочу запустить существующие простые примеры и написать простой код, используя GStreamer, в частности, используя его привязки Python.Я хочу установить пакеты и т.д., чтобы включить это.
Вот пример.
http://brettviren.github.io/pygst-tutorial-org/pygst-tutorial.html
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst
Gst.init(None)
# ...
my_playbin = Gst.ElementFactory.make("playbin", None)
assert my_playbin
print my_playbin
Я не могу заставить работать PyGObject, поэтому яЯ застрял прямо на import gi
и не могу продвинуться дальше первой строки.
Платформа MacOS 10.12.6 и Python 3.6.5.
computer:Desktop me$ python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gi'
>>>
Хорошодавайте RTFM.
https://pygobject.readthedocs.io/en/latest/getting_started.html#macosx-getting-started
Кажется довольно простым, и это должно установить PyGObject, верно?
Я уже установил Homebrew, но давайте просто сделаем этоеще раз, чтобы быть уверенным.
computer:Desktop me$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
[Snip for brevity]
==> Installation successful!
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
computer:Desktop me$
ОК, теперь давайте установим pygobject3 и gtk + 3
computer:Desktop me$ brew install pygobject3 gtk+3
Updating Homebrew...
Warning: pygobject3 3.32.1 is already installed and up-to-date
To reinstall 3.32.1, run `brew reinstall pygobject3`
Warning: gtk+3 3.24.8 is already installed and up-to-date
To reinstall 3.24.8, run `brew reinstall gtk+3`
computer:Desktop me$
Теперь давайте попробуем Python снова:
computer:Desktop me$ python3
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gi'
>>>
Итак, мыМы следовали инструкциям, и мы все еще находимся там, где мы начали без каких-либо функций.
Также пробовал различные варианты --with-python3
и --without-python
во время установки brew.
computer:Desktop me$ brew install pygobject3 --with-python3 --without-python
Updating Homebrew...
[SNIP FOR BREVITY]
Error: invalid option: --with-python3
Всеиз этих опций недопустимы, несмотря на то, что они упоминаются в различных интернет-ветках.
computer:Desktop me$ brew install pygobject3 --with-python@2 gtk+3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.
[SNIP FOR BREVITY]
Error: invalid option: --with-python@2
Может кто-нибудь сказать мне, что мне не хватает, пожалуйста