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 'absl' has no attribute 'flags' #119

Closed
sehargul-123 opened this issue Oct 31, 2019 · 7 comments
Closed

AttributeError: module 'absl' has no attribute 'flags' #119

sehargul-123 opened this issue Oct 31, 2019 · 7 comments

Comments

@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/logging.py", line 6, in
from util.flags import FLAGS
File "/home/sehar/DeepSpeech/util/flags.py", line 6, in
FLAGS = absl.flags.FLAGS
AttributeError: module 'absl' has no attribute 'flags'
please help me resolve this issue I am using tensorflow 1.14 gpu based

@yilei
Copy link
Contributor

yilei commented Oct 31, 2019

This isn't a absl specific issue, but:

Note that import logging tries to import /home/sehar/DeepSpeech/logging.py, instead of Python's standard logging module

You likely have '' in your sys.path before the standard modules, and /home/sehar/DeepSpeech/ is your current directory. Can you rename /home/sehar/DeepSpeech/logging.py to something else?

@sehargul-123
Copy link
Author

i am not getting you please can you explain me in detail

@sehargul-123
Copy link
Author

what should I rename it?? can u give me a name as an example

@sehargul-123
Copy link
Author

will u reply please

@yilei
Copy link
Contributor

yilei commented Nov 4, 2019

Looks like you are using https://github.com/mozilla/DeepSpeech?

I checked DeepSpeech's code, /home/sehar/DeepSpeech/logging.py seems to match https://github.com/mozilla/DeepSpeech/blob/master/util/logging.py, but the file is located inside the util directory.

I'm not sure where /home/sehar/DeepSpeech/logging.py comes from, do you have /home/sehar/DeepSpeech/util/logging.py exists? What if you remove /home/sehar/DeepSpeech/logging.py, or move the file to the util directory?

What if you delete /home/sehar/DeepSpeech and re-install it?

@yilei
Copy link
Contributor

yilei commented Dec 3, 2019

Closing due to inactivity. Feel free to re-open if you have more questions.

@yilei yilei closed this as completed Dec 3, 2019
@incupadAftab
Copy link

incupadAftab commented Apr 12, 2023

This error maybe comes when you run your DeepSpeech.py script with sudo command.
if you are using sudo for running you should use sudo to install the modules.
Try the 'sudo python -m pip install absl-py' instead of pip installed absl-py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants