[Bug] ModuleNotFoundError: no module named 'logging.config'
See original GitHub issue🐛 Bug
To reproduce
following tutorial: https://cli.dev/docs/tutorial/logging
** Minimal Code/Config snippet to reproduce **
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import hydra
log = logging.getLogger(__name__)
@hydra.main()
def my_app(_cfg):
log.info('info level message')
log.debug('debug level message')
** Stack trace/error message **
Traceback (most recent call last):
File "logging.py", line 4, in <module>
import logging
File "$HOME/workspace/hydra_test/logging.py", line 5, in <module>
import hydra
File "$HOME/miniconda3/lib/python3.7/site-packages/hydra/__init__.py", line 2, in <module>
from . import utils
File "$HOME/miniconda3/lib/python3.7/site-packages/hydra/utils.py", line 2, in <module>
import logging.config
ModuleNotFoundError: No module named 'logging.config'; 'logging' is not a package
Expected Behavior
executes successfully (without package import error)
System information
0.90
Linux 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
ModuleNotFoundError: No module named 'logging-config'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'logging-config' How to remove the Mod.
Read more >python 3.x - ImportError: No module named 'logging.handlers ...
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...
Read more >no module named 'logging' error : PY-6097 - YouTrack
Packages are not show for Jython: no module named 'logging' error. Instead error is shown: Traceback (innermost last): File ...
Read more >logging.config — Logging configuration — Python 3.11.1 ...
Starts up a socket server on the specified port, and listens for new configurations. If no port is specified, the module's default DEFAULT_LOGGING_CONFIG_PORT ......
Read more >ImportError: no module named 'logging'
Re: ImportError: no module named 'logging' ... It wouldn't be available - MicroPython is a subset. Not all libraries can be implemented.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh. Your file is called logging.py, I think it’s confusing python and shadowing the logging package. I am 99% sure this is it, sure enough to close this 😃 reopen if renaming it does not fix the problem.
Also environment.yaml from: also attach
conda env export > environment.yaml
and the output of:Try reproducing with a fresh conda env.
There is a new version of Hydra (0.10.0) but I don’t think it should make a difference, so install the same version to make things clearer. if it works in the clean env, it’s either some conflict with something else you have in your conda env - or maybe you are not actually running the python version you think you are.
In any case, I will need minimal repro instructions.