Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 方法调用解析为类上的函数调用_Python_Python 2.7_Methods_Twisted - Fatal编程技术网

Python 方法调用解析为类上的函数调用

Python 方法调用解析为类上的函数调用,python,python-2.7,methods,twisted,Python,Python 2.7,Methods,Twisted,我有python2.7和twistd框架。我正在使用==0.14.1.3库 我的twistd插件的前两行代码如下: from theseus import Tracer t = Tracer() t.install() 我例外地失败了: exceptions.TypeError:install()只接受一个参数(给定0) 这里怎么了?看起来它不是在对象接收器上调用的,而是在类上调用的 这似乎是由于twisted theseus的一个已知问题造成的: Github问题有一个解决办法: $ pi

我有python2.7和twistd框架。我正在使用==0.14.1.3库

我的twistd插件的前两行代码如下:

from theseus import Tracer

t = Tracer()
t.install()
我例外地失败了:

exceptions.TypeError:install()只接受一个参数(给定0)


这里怎么了?看起来它不是在对象接收器上调用的,而是在类上调用的

这似乎是由于twisted theseus的一个已知问题造成的:

Github问题有一个解决办法:

$ pip install cython
$ git clone https://github.com/habnabit/twisted-theseus
$ cd twisted-theseus
$ pip install .

对我来说,这段代码不会在Python2.7 virtualenv上出现任何错误,但在python3.6.x virtualenv上也会出现同样的错误,我很困惑,因为PyPI包自2016年以来就不可用了,作者知道。哇!