Forums

error with pyflakes

When I try to run pyflakes from the commandline, I get a weird error:

$ pyflakes app.py 
Traceback (most recent call last):
  File "/usr/bin/pyflakes", line 4, in <module>
    main()
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 86, in main
    warnings += checkPath(arg)
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 69, in checkPath
    return check(open(filename, 'rb').read() + b'\n', filename)
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 55, in check
    w = checker.Checker(tree, filename)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 181, in __init__
    self.handleChildren(tree)

What am I doing wrong?

It's not a full error message.

[edited by admin: formatting]

Traceback (most recent call last):
  File "/usr/bin/pyflakes", line 4, in <module>
    main()
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 86, in main
    warnings += checkPath(arg)
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 69, in checkPath
    return check(open(filename, 'rb').read() + b'\n', filename)
  File "/usr/lib/python3.8/site-packages/pyflakes/scripts/pyflakes.py", line 55, in check
    w = checker.Checker(tree, filename)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 181, in __init__
    self.handleChildren(tree)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 383, in handleChildren
    self.handleNode(node, tree)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 405, in handleNode
    handler(node)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 581, in ASSIGN
    self.handleNode(node.value, node)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 405, in handleNode
    handler(node)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 383, in handleChildren
    self.handleNode(node, tree)
  File "/usr/lib/python3.8/site-packages/pyflakes/checker.py", line 404, in handleNode
    handler = getattr(self, nodeType)
AttributeError: 'Checker' object has no attribute 'CONSTANT'

Hi, try running it like that: python -m pyflakes app.py.