我在安装了pysnooper之后,运行github上的例子:
import pysnooper
@ pysnooper.snoop()
def number_to_bits(number):
if number:
bits = []
while number:
number,remainder = divmod(number,2)
bits.insert(0,remainder)
return bits
else:
return [ 0 ]
number_to_bits(6)
错误:
PS E:\PYTHON\pace 2> & E:/Anaconda3/python.exe "e:/PYTHON/pace 2/1.py"
Traceback (most recent call last):
File "e:/PYTHON/pace 2/1.py", line 3, in <module>
@ pysnooper.snoop()
AttributeError: module 'pysnooper' has no attribute 'snoop'
在网上找了各种方法都没能解决~