如何在mac上安装pync

时间:2013-11-21 07:31:45

标签: python macos notifications nsusernotification nsusernotificationcenter

我想在mac上安装pync以显示通知。我试过

$ pip install pync

git clone git://github.com/SeTeM/pync.git
cd pync
python setup.py install

sudo easy_install pync

将错误显示为:

Last login: Thu Nov 21 12:20:51 on ttys000
fiss-Mac:~ fis$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.macosx-10.8-intel/egg/pync/__init__.py", line 3, in <module>
  File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 99, in <module>
  File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 27, in __init__
Exception: pync was not properly installed. Head over to https://github.com/SeTeM/pync/ and file a bug.
>>> 

3 个答案:

答案 0 :(得分:1)

您应该尝试pip3安装pync,因为pip3适用于Mac,而不仅仅是pip。那是你应该尝试的。如果这不起作用-那么您应该尝试从GitHub链接中安装它,如上述答案之一所述。希望我有帮助! (:

答案 1 :(得分:0)

似乎Python Package Index中 pync 的包无法正常运行。

直接从pync github repo安装即可解决问题:

pip install git+https://github.com/SeTeM/pync.git

答案 2 :(得分:0)

刚刚遇到同样的问题。 解压缩egg文件有助于解决问题:

cd /Library/Python/2.7/site-packages
sudo unzip pync-1.4-py2.7.egg
sudo rm -r EGG-INFO pync-1.4-py2.7.egg

$ python
Python 2.7.6 (default, Nov 12 2013, 13:26:39) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
>>>