我正试图从一个github repo安装一个基于Python的包,它最初是为另一个(可能是基于Debian的)Linux发行版安装的。在
程序似乎使用Python2,导入如下:
import argparse
import logging
import Queue
import collections
import ConfigParser
import os
import socket
import random
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
from multiprocessing import Process, Queue as MPQueue, Event
...
def notif(msg):
Notify.init("TheProg")
notice = Notify.Notification.new("Critical !", msg)
notice.set_urgency(2)
但是,当我试着运行程序时,我得到的是:
^{pr2}$我在google上搜索过自己累了,唯一发现的是一些关于PyGObject API Reference的神秘引用:
gir1.2-notify-0.7 (0.7.7-3)
Parent Project:
Desktop notification library (libnotify is a library for sending desktop notifications)
Description:
A library that sends desktop notifications to a notification daemon, as
defined in the Desktop Notifications spec. These notifications can be
used to inform the user about an event or display some form of
information without getting in the user’s way.
pip2 search notify
会返回数百个看似不相关的内容。在apt search notify
相同。在问:如何找到并安装正确的Notify
东西?
在发布问题后不久,我就找到了解决方案。在
然后通过安装以下部件来解决问题:
^{pr2}$但也可以将notify2与:
sudo pip2 install notify2
一起使用。在相关问题 更多 >
编程相关推荐