1

i try to install pygobject for python 3 in fedora 18 i read this doc https://python-gtk-3-tutorial.readthedocs.org/en/latest/install.html and i try to install jhbuild after that when i type $ jhbuild sanitycheck get this error : bash: jhbuild: command not found...

i try to install with yum , i install "pygobject3-devel" but this not work with python3 in fedora 18 default python is python2.7.3, i install python3.3.0 with yum and test a first demo code :

#!/usr/bin/python
from gi.repository import Gtk

win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()

after give chmod +x for this python file can run with this command "./test.py" and if i try to run with python (with out use #! ....) and type this command "$python test.py" that run and work without any problem but when i type this command "$python3 test.py" i get this error :

Traceback (most recent call last):
  File "test.py", line 2, in <module>
    from gi.repository import Gtk
ImportError: No module named 'gi'

have any idea ? thanks

4

1 に答える 1

3

pygobject3代わりにインストールしてみてくださいpygobject3-dev(実際のところ、pygobject3 は Fedora の vainilla インストールに既にインストールされているようです)。

そのパッケージをインストールした後、インタープリター (python2.7) を開いて以下を実行できるはずです。

from gi.repository import Gtk

python3 を使用したい場合 (python3を使用しようとしたのか、それともpython3を使用したいのかわかりませんでした)、gnome インストロスペクション バインディングはまだ利用できないようです。作業中の python3 関連のさまざまなパッケージ。

編集:インストールを試みましpython3-gobjectた(インストール時にインストールする必要がありますpygobject3が、何らかの理由でインストールされていません)。python3でも機能しているようです。

于 2013-02-14T02:34:56.260 に答える