如何安装适用于python 3的notify2(ubuntu)

时间:2019-09-11 19:02:48

标签: python-3.x ubuntu dbus

我这样做:

 pip3 install notify2

在这里什么也看不到:

Requirement already satisfied: notify2 in ./lib/python3.6/site-packages (0.3.1)

但是,然后在ipython中:

import notify2    

给予:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-c7f84c424148> in <module>
----> 1 import notify2

~/Desktop/work/p1/geqw4/vi3/out/sp/some_ice/our_code/lib/python3.6/site-packages/notify2.py in <module>
     37 """
     38 
---> 39 import dbus
     40 
     41 __version__ = '0.3.1'

ModuleNotFoundError: No module named 'dbus'





pip3 install dbus-python

ERROR: Command errored out with exit status 1:
   command: /home/kaveh/Desktop/work/p1/geqw4/vi3/out/sp/some_ice/our_code/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l24l4qj5/dbus-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l24l4qj5/dbus-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-m4k9gcrs --python-tag cp36

...

我这样做:

 sudo apt install python3-dbus

给出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-dbus is already the newest version (1.2.6-1).
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

但是,在ipython中执行import notify2会产生与以前相同的错误。

0 个答案:

没有答案