Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'module' object has no attribute 'init' on startup #58

Closed
mistrey opened this issue Sep 4, 2017 · 9 comments · Fixed by #60
Closed

AttributeError: 'module' object has no attribute 'init' on startup #58

mistrey opened this issue Sep 4, 2017 · 9 comments · Fixed by #60
Labels
🐛 bug Something isn't working, or a fix is proposed

Comments

@mistrey
Copy link

mistrey commented Sep 4, 2017

To reproduce:

mdedup --help

results in

Traceback (most recent call last):
  File "/usr/bin/mdedup", line 7, in <module>
    from maildir_deduplicate.cli import cli
  File "/usr/lib/python3.6/site-packages/maildir_deduplicate/cli.py", line 51, in <module>
    @click_log.init(logger)
AttributeError: module 'click_log' has no attribute 'init'

Cause:

The user interface of click_log has changed in version 0.2.0.
See

@bdillahu
Copy link

bdillahu commented Sep 5, 2017

Looks like you can change:

/usr/lib/python3.6/site-packages/maildir_deduplicate/cli.py

Line: 51 and 52:
#@click_log.init(logger)
@click_log.simple_verbosity_option('logger',
default='INFO', metavar='LEVEL',
help='Either CRITICAL, ERROR, WARNING, INFO or DEBUG. Defaults to INFO.')

Line: 59:
level = logging.getLogger('logger').level

Not sure if there is more or not...

@mistrey
Copy link
Author

mistrey commented Sep 6, 2017

Thanks bdillahu,

I made changes in cli.py and deduplicate.py in the spirit of this project. Now the script is running and showing all log entries until I finally run into #57 :-(

@bdillahu
Copy link

bdillahu commented Sep 6, 2017

Yeah, I commented out the one assert that it was failing on, but I'm not really sure that is 1) safe, and 2) working... I haven't had much time to test since then.

@mistrey
Copy link
Author

mistrey commented Sep 6, 2017

Neither safe nor working. It just blocks my terminal after showing the report tables. Strange enough, I cannot find a running python process.

mistrey pushed a commit to mistrey/maildir-deduplicate that referenced this issue Sep 8, 2017
Fix breaking API change
introduced with Click-Log 0.2.0.

Running the script with Python 3.5
required to capture a UnicodeEncodeError exception
instead of UnicodeDecodeError.
@kdeldycke kdeldycke added the bug label Sep 22, 2017
@jefftemplon
Copy link

Hi,
I have this issue now with the current version (just now did pip install) and python 2.7.15 (current homebrew version) - what gives?

@basvanbeeknl
Copy link

Although the patch provided by @bdillahu prevented from showing the error the application did not do the task.

The real fix for me was to clone the repository and use the develop branch:

git clone git@github.com:kdeldycke/maildir-deduplicate.git;
cd maildir-deduplicate;
python ./setup.py develop

@sehargul-123
Copy link

Traceback (most recent call last):
File "DeepSpeech.py", line 11, in
import absl.app
File "/home/sehar/venv/lib/python3.6/site-packages/absl/app.py", line 40, in
from absl import flags
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/init.py", line 41, in
from absl.flags import _defines
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_defines.py", line 31, in
from absl.flags import _flagvalues
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_flagvalues.py", line 27, in
import logging
File "/home/sehar/DeepSpeech/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/converter.py", line 52, in
STANDARD_CRITICAL = logging.CRITICAL
AttributeError: module 'logging' has no attribute 'CRITICAL'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/init.py", line 5, in
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in
import apt
File "/usr/lib/python3/dist-packages/apt/init.py", line 26, in
from apt.package import Package
File "/usr/lib/python3/dist-packages/apt/package.py", line 24, in
import logging
File "/home/sehar/DeepSpeech/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/converter.py", line 52, in
STANDARD_CRITICAL = logging.CRITICAL
AttributeError: module 'logging' has no attribute 'CRITICAL'

Original exception was:
Traceback (most recent call last):
File "DeepSpeech.py", line 11, in
import absl.app
File "/home/sehar/venv/lib/python3.6/site-packages/absl/app.py", line 40, in
from absl import flags
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/init.py", line 41, in
from absl.flags import _defines
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_defines.py", line 31, in
from absl.flags import _flagvalues
File "/home/sehar/venv/lib/python3.6/site-packages/absl/flags/_flagvalues.py", line 27, in
import logging
File "/home/sehar/DeepSpeech/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/init.py", line 92, in
from absl.logging import converter
File "/home/sehar/venv/lib/python3.6/site-packages/absl/logging/converter.py", line 52, in
STANDARD_CRITICAL = logging.CRITICAL
AttributeError: module 'logging' has no attribute 'CRITICAL'

@sehargul-123
Copy link

I got this error while running my run file for training my model

@github-actions
Copy link

github-actions bot commented Oct 5, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2020
@kdeldycke kdeldycke added 🐛 bug Something isn't working, or a fix is proposed and removed bug labels Nov 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working, or a fix is proposed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants