I will use RotatingFileHandler in Python 3.5.3 64 bit
I try a lot of example, but by all I got the same Error after few lines:
import logging
from logging.handlers import RotatingFileHandler
but I got the folling Error:
ImportError: No module named 'logging.handlers'; 'logging' is not a package
Sorry, I was not able to read the Errormessage in the right way. My mistake was the filename logging.py - the Py-file was opened by himself
Traceback (most recent call last):
File "C:\Python-Projects\logging.py", line 1, in <module>
import logging
File "C:\Python-Projects\logging.py", line 2, in <module>
from logging.handlers import RotatingFileHandler
ImportError: No module named 'logging.handlers'; 'logging' is not a package
Solution is rename the file to anything else like logging-test.py and be sure, that there is no other file like logging.py.
I spent 3 days for that mistake. Thanks for support.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With