My Telegram bot runs successfully in console mode, but when I try to run it as an always-on task with the command python3.6 /home/yellowparrot/telegram/OCR_bot1.py
, I get this error:
Nov 22 09:41:50 Traceback (most recent call last):
Nov 22 09:41:50 File "/home/yellowparrot/telegram/OCR_bot1.py", line 5, in <module>
Nov 22 09:41:50 import telepot
Nov 22 09:41:50 File "/home/yellowparrot/.local/lib/python3.6/site-packages/telepot/__init__.py", line 4, in <module>
Nov 22 09:41:50 import json
Nov 22 09:41:50 File "/usr/lib/python3.6/json/__init__.py", line 106, in <module>
Nov 22 09:41:50 from .decoder import JSONDecoder, JSONDecodeError
Nov 22 09:41:50 File "/usr/lib/python3.6/json/decoder.py", line 3, in <module>
Nov 22 09:41:50 import re
Nov 22 09:41:50 File "/usr/lib/python3.6/re.py", line 142, in <module>
Nov 22 09:41:50 class RegexFlag(enum.IntFlag):
Nov 22 09:41:50 AttributeError: module 'enum' has no attribute 'IntFlag'
What's the problem with importing the standard re module?