1
我試圖在Mac OSX 10.9.5的計算機上用Glade UI運行我的Python3程序。如何在osx上運行Python GTK +?
$ python3 gedder.py
Traceback (most recent call last):
File "gedder.py", line 7, in <module>
import gi
ImportError: No module named 'gi'
我想從蘋果安裝Xcode_6.2.dmg時應該已經得到了GTK +和通https://wiki.gnome.org/Projects/GTK+/OSX/Building工作。
但是我怎麼能得到正確的gi
庫?當與pip3
一起安裝時,它給出了相當矛盾的結果。圖書館有在Python 3.5庫,但顯然它有Python2代碼:
$ pip3 install gi
Collecting gi
Using cached gi-1.2.tar.gz
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from gi)
Installing collected packages: gi
Running setup.py install for gi ... done
Successfully installed gi-1.2
$ python3 gedder.py
Traceback (most recent call last):
File "gedder.py", line 7, in <module>
import gi
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/gi/__init__.py", line 39
print url
^
SyntaxError: Missing parentheses in call to 'print'
程序在我的Ubuntu 16.4 Linux系統創建格萊德3.18.3和pip3 freeze
列表中有pygobject==3.20
。