Forums

NameError: name '_pa_run' is not defined

Try to start my bot and get this:

Traceback (most recent call last):
  File "/bin/pythonanywhere_runner.py", line 3, in <module>
    import traceback
  File "/usr/lib/python3.6/traceback.py", line 5, in <module>
    import linecache
  File "/usr/lib/python3.6/linecache.py", line 11, in <module>
    import tokenize
  File "/usr/lib/python3.6/tokenize.py", line 33, in <module>
    import re
  File "/usr/lib/python3.6/re.py", line 142, in <module>
    class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
>>> _pa_run(u'/home/gresaggr/mysite/flask_app.py')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '_pa_run' is not defined

Have you created a file called enum anywhere?

And or could you have installed any packages that provided (overwrote) an enum.py? This sometimes happens when you try to a package that was supposed to be for python2 and you installed into python3.

Try to import enum and then print enum._file_ to see where your enum module is coming from.