weixin 支付接口

以前用的 python sdk 项目废弃了, 改用 https://github.com/jxtech/wechatpy/

install

sudo pip install wechatpy

安装依赖的 python-dateutil 时出现了惨烈的报错

Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1431, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 598, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1836, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 295, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 299, in move
    copytree(src, real_dst, symlinks=True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors

没有权限删除老的 python-dateutil

看看这篇 http://www.jianshu.com/p/22b89f19afd6 自已为是的 mac, 多事的 csrutil

按其操作以后ok

wechatpy import 时找不到, 不知 mac 下旳 python 出了什么鬼问题. pip 安到了 /Library/Python/2.7/site-packages

但是 pytohn 只找 /usr/local/lib/python2.7/site-packages

真是搞, 加到 .bash_profile export PYTHONPATH=~/lib_p_bz:/Library/Python/2.7/site-packages