如何在MacOS上为python27安装jsonrpc

鲁斯兰

我想检查代码的操作:

  from txjsonrpc.web import jsonrpc
  from twisted.web import server
  from twisted.internet import reactor

  class Math(jsonrpc.JSONRPC):
    """
    An example object to be published.
    """
  def jsonrpc_add(self, a, b):
    """
    Return sum of arguments.
    """
    return a + b

reactor.listenTCP(7080, server.Site(Math()))
reactor.run()

但我收到一条错误消息:

/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7/Users/___/server.py
Traceback (most recent call last):
  File "/Users/___/server.py", line 1, in <module>
    from txjsonrpc.web import jsonrpc
ImportError: No module named txjsonrpc.web

Process finished with exit code 1

运行:pip install jsonprc下载/解压jsonprc找不到符合要求jsonprc的任何下载清理...找不到jsonprc的所有发行版

帮助新手程序员;)

迪特斯

安装说明只是一个google搜索内容:

https://pypi.python.org/pypi/txJSON-RPC/0.3

祝您黑客愉快!

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章