View in #prefect-community on Slack
Problem
@Andrea_Nerla: Hi folks, I’m receiving this error every time I try to run a Prefect script. For context I’m trying to receive Slack’s status notifications so I added the SLACK_WEBHOOK_URL in the config.toml and I’ve also opened prefect’s _init_.py
out of curiosity. I don’t think I changed anything in it but I might have misclicked something.
File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 516, in __getattr__
`value = object.__getattribute__(self, item)
AttributeError: 'Config' object has no attribute 'datefmt'
Entire log:
Traceback (most recent call last):
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 488, in __getitem__
return super().__getitem__(item)`
KeyError: 'datefmt'
`The above exception was the direct cause of the following exception:`
`Traceback (most recent call last):`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 514, in __getattr__`
`value = self.__getitem__(item, _ignore_default=True)`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 509, in __getitem__`
`raise BoxKeyError(str(err)) from _exception_cause(err)`
`box.exceptions.BoxKeyError: "'datefmt'"`
`During handling of the above exception, another exception occurred:`
`Traceback (most recent call last):`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 516, in __getattr__`
`value = object.__getattribute__(self, item)`
`AttributeError: 'Config' object has no attribute 'datefmt'`
`The above exception was the direct cause of the following exception:`
`Traceback (most recent call last):`
`File "c:\Users\andrea.nerla\Desktop\sidal\sidal prefect\prefect test var risorsas.py", line 1, in <module>`
`import prefect`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\__init__.py", line 1, in <module>`
`import prefect.utilities`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\__init__.py", line 1, in <module>`
`import prefect.utilities.logging`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\logging.py", line 261, in <module>`
`context.logger = prefect_logger = configure_logging()`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\__init__.py", line 1, in <module>`
`import prefect.utilities`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\__init__.py", line 1, in <module>`
`import prefect.utilities.logging`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\logging.py", line 261, in <module>`
`context.logger = prefect_logger = configure_logging()`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\logging.py", line 258, in configure_logging`
`return _create_logger(name)`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\prefect\utilities\logging.py", line 230, in _create_logger`
`context.config.logging.format, context.config.logging.datefmt`
`File "C:\Users\andrea.nerla\AppData\Local\Programs\Python\Python39\lib\site-packages\box\box.py", line 530, in __getattr__`
`raise BoxKeyError(str(err)) from _exception_cause(err)`
`box.exceptions.BoxKeyError: "'Config' object has no attribute 'datefmt'"`
@Kevin_Kho: Are you using flow.run()
or is this with an agent?
@Andrea_Nerla: Right now I restarted the system and I’m trying to run prefect agent local start
, which gives me this error. But before of it I was having the same error with a flow.run()
@Kevin_Kho: Can you do pip show python-box
in your terminal and show me the output?
@Andrea_Nerla:
@Kevin_Kho: And for pip show prefect
?
@Andrea_Nerla:
Solution
@Kevin_Kho: I am on the same but can’t replicate. I would honestly just try re-installing prefect
@Andrea_Nerla: It did resolve the error, thanks.