cool-RR / PySnooper

Never use print for debugging again
MIT License
16.34k stars 951 forks source link

Showing the error while running the python code with pysnooper #173

Closed sadow984 closed 4 years ago

sadow984 commented 4 years ago

@pysnooper.snoop() AttributeError: partially initialized module 'pysnooper' has no attribute 'snoop' (most likely due to a circular import)

cool-RR commented 4 years ago

Interesting, but we'll need a reproducible example.

On Tue, Dec 3, 2019, 08:49 sadow984 notifications@github.com wrote:

@pysnooper.snoop() AttributeError: partially initialized module 'pysnooper' has no attribute 'snoop' (most likely due to a circular import)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cool-RR/PySnooper/issues/173?email_source=notifications&email_token=AAAN3SWA3UIIP6AZDSBSQT3QWX6OFA5CNFSM4JUS5NR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5SCUWA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3SW4UBB4BQQZN25R4ZLQWX6OFANCNFSM4JUS5NRQ .

alexmojaki commented 4 years ago

Did you name your file pysnooper.py?

sadow984 commented 4 years ago

Did you name your file pysnooper.py?

yes

sadow984 commented 4 years ago

Interesting, but we'll need a reproducible example. On Tue, Dec 3, 2019, 08:49 sadow984 @.***> wrote: @pysnooper.snoop() AttributeError: partially initialized module 'pysnooper' has no attribute 'snoop' (most likely due to a circular import) — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#173?email_source=notifications&email_token=AAAN3SWA3UIIP6AZDSBSQT3QWX6OFA5CNFSM4JUS5NR2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H5SCUWA>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN3SW4UBB4BQQZN25R4ZLQWX6OFANCNFSM4JUS5NRQ .

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)

cool-RR commented 4 years ago

Good catch Alex. Yeah, you definitely can't name your file pysnooper.py.

sadow984 commented 4 years ago

ok,got it
thanks