python - AttributeError: 'module' object has no attribute 'config' -
i'm new python , trying first applications. why getting attribute message:
traceback (most recent call last): file "c:\users\myname\documents\visual studio 2010\projects\pythonapplication 1\pythonapplication1\runsikulionvm.py", line 97, in logging.config.dictconfig(log_dict_config_onvm) attributeerror: 'module' object has no attribute 'config' press key continue . . .
here portion of code far:
import os import sys import subprocess import fnmatch import datetime import logging import logging.handlers import logging.config """===global variables===""" logfile = r"v:/runtests.log" logdetails= r"v:/sikuliscriptdetails.log" failedtests = r"v:/failedtests.txt" """logging configuration""" # dictionary configuration logging within runsikulionvm.py log_dict_config_onvm = { 'version': 1, 'disable_existing_loggers': false, 'formatters': { 'verbose': { 'format': '%(levelname)-8s %(asctime)s %(module)s %(process)d %(thread)d %(message)s', 'datefmt': '%a, %d %b %y %h:%m:%s' }, 'standard': { 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s', 'datefmt': '%a, %d %b %y %h:%m:%s' }, 'simple': { 'format': '%(asctime)s %(levelname)-8s %(message)s', 'datefmt': '%a, %d %b %y %h:%m:%s' } }, 'handlers': { 'console': { 'level':'debug', 'class':'logging.streamhandler', 'formatter': 'simple' }, 'runtests_handler': { 'class': 'logging.handlers.timedrotatingfilehandler', 'level': 'debug', 'formatter': 'simple', 'filename': logfile, 'when':'d', 'interval': 7, 'backupcount':1, 'encoding': none, 'delay': false, 'utc': false, }, 'sikuliscriptdetails_handler': { 'class': 'logging.handlers.timedrotatingfilehandler', 'level': 'debug', 'formatter': 'verbose', 'filename':logdetails, 'when':'d', 'interval': 7, 'backupcount':2, 'encoding': none, 'delay': false, 'utc': false, }, 'failedtests_handler': { 'class': 'logging.handlers.timedrotatingfilehandler', 'level': 'debug', 'formatter': 'standard', 'filename':failedtests, 'when':'d', 'interval': 7, 'backupcount':2, 'encoding': none, 'delay': false, 'utc': false, } }, 'loggers': { 'runtests_logger': { 'handlers': ['runtests_handler'], 'level': 'debug', 'propagate': false }, 'sikuliscriptdetails_logger': { 'handlers': ['sikuliscriptdetails_handler'], 'level': 'debug', 'propagate': false }, 'failedtests_logger': { 'handlers': ['failedtests_handler'], 'level': 'debug', 'propagate': false } } } logging.config.dictconfig(log_dict_config_onvm) logfilelogger = logging.getlogger('runtests_logger') logdetailslogger = logging.getlogger('sikuliscriptdetails_logger') failedtestslogger = logging.getlogger('failedtests_logger')
ps: of indentation off...
i'm newbie. had same problem. deleted crud in directory (build , dist folders etc), rebuilt all. bingo! suspect that, alain suggested, pycharm has cached undesirable.
Comments
Post a Comment