我已经安装了gnuhealth,当我运行gnuhealthclient并使用我的用户名和密码登录时,它显示一条错误消息,提示gtk问题:未找到模块
我正在使用centos 7,并且已经使用以下命令安装了gtk +和gtk3:
$ sudo yum install gtk3
$ sudo yum install gtk3-devel
$ sudo yum install gtk +
当我检查已安装软件包的列表时,我发现gtk +和gtk3甚至是gtk 2
谁能告诉我这是什么问题?
这是错误消息:
const player = { currentChoice: null };
const computer = { currentChoice: null };
const choices = ["Rock", "Paper", "Scissors"];
player.currentChoice = choices[2];
window.onload = function() {
const rockButton = document.getElementById('rock');
rockButton.addEventListener('click', updateRock);
};
function updateRock(){
player.currentChoice = choices[0];
}
答案 0 :(得分:1)
您的.py文件应包含
导入gtk
应替换为
从gi.repository导入Gtk
在Gnuhealth源代码中,一些文件包含两个库调用,另一些文件仅在不指定源存储库的情况下调用gtk库。代码不是很干净。
感谢这些解释here: gi.repository是PyGObject的Python模块(代表Python GObject自省),其中包含Python绑定并支持GTK + 3工具包和GNOME应用程序
答案 1 :(得分:0)
首次导入gi
import gi
设置所需的所需版本
gi.require_version('Gtk', '3.0')
最后
from gi.repository import Gtk